strtotime returns 00:00 for 7am

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

 



Hi all
I'm new to this list. I hope this hasn't been discussed already.

using this code:

function test_time($time_string) {
   echo strftime("%X %A, %b %e\n", strtotime($time_string));
}

test_time('now');
test_time('4pm + 2 Hours');
test_time('now + 2 fortnights');
test_time('last Monday');
test_time('tomorrow');
test_time('5am tomorrow');
test_time('7am 12 days ago');

gives this output:

21:46:18 Wednesday, Jun 20

18:00:00 Wednesday, Jun 20

21:46:18 Wednesday, Jul 18

00:00:00 Monday, Jun 18

00:00:00 Thursday, Jun 21

00:00:00 Thursday, Jun 21

07:00:00 Friday, Jun  8


I'm wondering why the 2nd and 3rd last both give 00:00 as the
time. Especially why 5am tomorrow doesn't work. Using PHP5.


Thanks


Phil P.

[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