ID: 37368
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Assigned
Bug Type: Date/time related
Operating System: Debian sarge
PHP Version: 5.1.4
Assigned To: derick
New Comment:
Actually, I meant that I expect the output to be (Wed should be changed
to Mon):
Mon, 08 May 2006 00:00:00 -0400
Mon, 15 May 2006 00:00:00 -0400
Mon, 22 May 2006 00:00:00 -0400
Mon, 29 May 2006 00:00:00 -0400
Mon, 05 Jun 2006 00:00:00 -0400
Previous Comments:
------------------------------------------------------------------------
[2006-05-24 21:34:23] [EMAIL PROTECTED]
I'm not sure whether this is related, but I found a new issue with
strtotime(). It looks like the words "second" and "third" are not
working correctly.
Reproduce code:
echo date('r', strtotime('May 1st first Monday')) . "\n";
echo date('r', strtotime('May 1st second Monday')) . "\n";
echo date('r', strtotime('May 1st third Monday')) . "\n";
echo date('r', strtotime('May 1st fourth Monday')) . "\n";
echo date('r', strtotime('May 1st fifth Monday')) . "\n";
I expect the output to be:
Mon, 08 May 2006 00:00:00 -0400
Wed, 15 May 2006 00:00:00 -0400
Wed, 22 May 2006 00:00:00 -0400
Mon, 29 May 2006 00:00:00 -0400
Mon, 05 Jun 2006 00:00:00 -0400
but the actual output (with PHP 5.1.4) is:
Mon, 08 May 2006 00:00:00 -0400
Wed, 31 Dec 1969 19:00:00 -0500
Wed, 31 Dec 1969 19:00:00 -0500
Mon, 29 May 2006 00:00:00 -0400
Mon, 05 Jun 2006 00:00:00 -0400
With PHP 4.4.2, the actual output is:
Tue, 01 May 2001 00:00:00 -0400
Mon, 01 May 2006 00:00:01 -0400
Thu, 01 May 2003 00:00:00 -0400
Sat, 01 May 2004 00:00:00 -0400
Sun, 01 May 2005 00:00:00 -0400
------------------------------------------------------------------------
[2006-05-14 17:35:45] [EMAIL PROTECTED]
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2006-05-08 17:16:01] [EMAIL PROTECTED]
Description:
------------
When using strtotime() in PHP 5.1.4, it returns an inaccurate
timestamp, but PHP 5.0.4 and 4.4.2 return the correct timestamp.
Reproduce code:
---------------
php -r 'echo date("r", strtotime("Mon, 08 May 2006 13:06:44 -0400 +30
days"));'
Expected result:
----------------
Wed, 07 Jun 2006 13:06:44 -0400
Actual result:
--------------
Mon, 12 Jun 2006 13:06:44 -0400
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37368&edit=1