Bug #53539 [Opn]: strtotime off-by-1-week bug still not fixed
| From: | kugel at rci dot rutgers dot edu | Date: | Mon, 13 Dec 2010 16:01:37 +0000 |
| Subject: | Bug #53539 [Opn]: strtotime off-by-1-week bug still not fixed | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-156967@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53539&edit=1
ID: 53539
User updated by: kugel at rci dot rutgers dot edu
Reported by: kugel at rci dot rutgers dot edu
-Summary: Bug still not fixed
+Summary: strtotime off-by-1-week bug still not fixed
Status: Open
Type: Bug
Package: *General Issues
Operating System: Fedora
PHP Version: 5.3SVN-2010-12-13 (SVN)
Block user comment: N
Private report: N
New Comment:
better bug title
Previous Comments:
------------------------------------------------------------------------
[2010-12-13 16:59:43] kugel at rci dot rutgers dot edu
Description:
------------
---
From manual page: http://www.php.net/function.strtotime#Changelog
---
"5.2.7 In PHP 5 prior to 5.2.7, requesting a given occurrence of a given
weekday in a month where that weekday was the first day of the month
would incorrectly add one week to the returned timestamp. This has been
corrected in 5.2.7 and later versions."
Contrary to the above, this bug still exists in PHP 5.2.13, 5.2.14, and
5.3.3.
Test script:
---------------
<?php
date_default_timezone_set("America/New_York");
echo date("D, M j Y", strtotime("first Saturday January 2011 8:00pm")) .
"\n";
echo date("D, M j Y", strtotime("third Saturday January 2011 8:00pm")) .
"\n";
?>
Expected result:
----------------
Sat, Jan 1 2011
Sat, Jan 15 2011
Actual result:
--------------
Sat, Jan 8 2011
Sat, Jan 22 2011
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53539&edit=1