#40861 [Csd->Asn]: strtotime() behaviour has changed
| From: | derick@php.net | Date: | Wed, 21 Mar 2007 09:41:21 +0000 |
| Subject: | #40861 [Csd->Asn]: strtotime() behaviour has changed | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-110637@lists.php.net to get a copy of this message | ||
ID: 40861
Updated by: derick@php.net
Reported By: eheien at heli-one dot ca
-Status: Closed
+Status: Assigned
Bug Type: Date/time related
Operating System: Windows 2003 and XP
PHP Version: 5.2.1
Assigned To: derick
New Comment:
Reverted that patch, as it was incorrect.
Previous Comments:
------------------------------------------------------------------------
[2007-03-21 00:25:45] iliaa@php.net
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.
------------------------------------------------------------------------
[2007-03-20 09:07:49] eheien at heli-one dot ca
Description:
------------
strtotime() fails when supplied with both a negative and positive
argument. This worked in php 5.0.5 and php 4.x.x.
+- = -
++ = +
-- = +
Reproduce code:
---------------
$offset = -60;
$ts = strtotime('2000-01-01 12:00:00');
$result = date("Y-m-d H:i:s", strtotime("+$offset minutes", $ts));
echo $result;
Expected result:
----------------
2000-01-01 11:00:00
Actual result:
--------------
1970-01-01 01:00:00
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40861&edit=1