#40804 [NEW]: strtotime returning bad dates (last <day>)
| From: | zirephoenix at rogers dot com | Date: | Wed, 14 Mar 2007 16:52:27 +0000 |
| Subject: | #40804 [NEW]: strtotime returning bad dates (last <day>) | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-110341@lists.php.net to get a copy of this message | ||
From: zirephoenix at rogers dot com
Operating system:
PHP version: 4.4.6
PHP Bug Type: Date/time related
Bug description: strtotime returning bad dates (last <day>)
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
--
Edit bug report at http://bugs.php.net/?id=40804&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40804&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40804&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40804&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40804&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=40804&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=40804&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=40804&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=40804&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=40804&r=support
Expected behavior: http://bugs.php.net/fix.php?id=40804&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=40804&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=40804&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40804&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40804&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40804&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=40804&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=40804&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=40804&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=40804&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=40804&r=mysqlcfg