strtotime( 'last Sunday' ) and republicans

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

 



Hey Rob,

Remember on 2007-09-18 at 22:45:37 when you suggested I do this:

http://marc.info/?l=php-general&m=119015558426248&w=2

Well.. today strtotime( 'last Sunday' ) screwed me and I'm writing to
say that I nearly fell out of my chair laughing when I realized what
the problem was, who caused it, and who "helped" me code it. :)

This issue only appears on an ancient PHP4 install as far as I can tell:

echo "Current time():\n";
echo date( 'Y-m-d H:i:s', time() );
echo "\nBroken strtotime( 'last Sunday' )\n";
echo date( 'Y-m-d H:i:s', strtotime( 'last Sunday' ) );
echo "\n";

> /usr/local/php4/bin/php test.php
Current time():
2008-03-10 20:03:39
Broken strtotime( 'last Sunday' )
2008-03-08 23:00:00

23:00?  Guess what we did to out clocks this past weekend?

I blame the republicans in general, and the short one named 'W' specifically.

I won't bother mentioning the fix as I'm sure 83,293,874,713 people
will post the same correct code by the end of the day tomorrow.  No
one runs PHP4 except _my_ clients anyway.  *shrug*


-- 
Greg Donald
http://destiney.com/

-- 
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