weird timestamp problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am working on an app that has 15 minute blocks of time to schedule meeting 
room reservations and have ran into an rather odd problem. Any ideas as to 
what could be causing this

I am expecting the block of code output this:

....
7:00PM
7:15PM

7:15PM
7:30PM

7:30PM
7:45PM
....etc

from 5:00 AM local time (PST) to 9:30 PM, but instead starting at 7:45PM, I 
see this (time jumps from 8:00 to 8:01).

7:45 PM
8:00 PM

8:01 PM
8:16 PM

8:16 PM
8:31 PM

8:31 PM
8:46 PM
....etc

What is odd is that the app works as intended if I use 30 minute blocks of 
15 minute blocks

Snippet of code is below

// menu start time
$start_c = mktime(5, 0, 0, $month_t, $day_t, $year_t);
// menu end time
$end_c = mktime(21, 30, 0, $month_t, $day_t, $year_t);

while($start_c < $end_c)
{
    $time_start = $start_c;
    $loop_s = $loop_s+900;
    $time_end = $end_c;

    $unix_e = $time_end-900;
    $unix_s = date("U", $time_start);

    $timeloop_e = date("g:i A", $time_end);
    $timeloop_s = date("g:i A", $time_start);
    print("<tr><td class=\"timeblock\" align=\"center\">". $timeloop_s ."<br 
/>". $timeloop_e . "</td>\n");

} 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux