|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-03-14 16:54 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 12:00:01 2025 UTC |
Description: ------------ My hosting told me to post the bug here instead of asking them to figure it out. They recently upgraded to 4.4.6 and the strtotime function started returning bad dates for some of the "last <day>" strings. The code below should show a continuous list of dates, but it doesn't. It seems to break from last week of today to last sunday. Reproduce code: --------------- <html> <body> <?php echo date("F d, Y", strtotime("last sunday")) . "<br>\n"; echo date("F d, Y", strtotime("last monday")) . "<br>\n"; echo date("F d, Y", strtotime("last tuesday")) . "<br>\n"; echo date("F d, Y", strtotime("last wednesday")) . "<br>\n"; echo date("F d, Y", strtotime("last thursday")) . "<br>\n"; echo date("F d, Y", strtotime("last friday")) . "<br>\n"; echo date("F d, Y", strtotime("last saturday")) . "<br>\n"; ?> </body> </html> Expected result: ---------------- March 11, 2007 March 12, 2007 March 13, 2007 March 07, 2007 March 08, 2007 March 09, 2007 March 10, 2007 Actual result: -------------- March 10, 2007 March 12, 2007 March 13, 2007 March 06, 2007 March 07, 2007 March 08, 2007 March 09, 2007