Date application (solved)
Posted: Mon Jun 28, 2010 10:05 am
I'm working on a simple date application that generates a table (kind of like a graph but not using graph libraries).
I'm not sure how to add 2.3 minutes (or whatever the interval would be) to a time in that format.
Code: Select all
$start = str_replace(".000000", "", $results['START_DATE'][0]);
// $start = 28-JUN-10 09.37.25 AM
$end = str_replace(".000000", "", $results['END_DATE'][0]);
// $end = 28-JUN-10 10.00.15 AM
// $DUR = the difference, in this case 23 minutes.
$columns = 10;
$rows = 5;
$interval = $DUR / 10;
// $interval = 2.3 (minutes)
$start_time = explode(" ", $start);
// $start_time[1] = 09.37.25
$interval_value = 0;
$starting_time = $start_time[1];
for ($i = 0; $i < $columns; $i++){
$interval_value = $interval_value + $interval;
$new_time = $starting_time + $interval_value;
// I want to display the start_time + interval_value;
// Logically: Loop1 9.37.25 + 2.3 minutes
// Logically: Loop2 ~9.39.25 + 2.3 minutes
// Logically: Loop3 ~9.43.25 + 2.3 minutes
// Logically: Loop10 ~ close to the end time
}
I'm not sure how to add 2.3 minutes (or whatever the interval would be) to a time in that format.