#32270 [Asn->Csd]: strtotime/date behavior
| From: | derick@php.net | Date: | Sat, 18 Jun 2005 14:23:22 +0000 |
| Subject: | #32270 [Asn->Csd]: strtotime/date behavior | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-80585@lists.php.net to get a copy of this message | ||
ID: 32270
Updated by: derick@php.net
Reported By: php at unfit dot org
-Status: Assigned
+Status: Closed
Bug Type: Date/time related
Operating System: Linux 2.4.23
PHP Version: 5.0.4, 4.3.11
Assigned To: derick
New Comment:
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.
Fixed for PHP 5.1.
Previous Comments:
------------------------------------------------------------------------
[2005-03-11 03:22:06] php at unfit dot org
Description:
------------
Negative timestamps seem to work with the date function but not the
strtotime function. This occurs on all of the Gentoo Linux boxes I am
running on both kernel version 2.4.23 and 2.4.28. I am running PHP
4.3.10 and Apache/2.0.52.
Reproduce code:
---------------
<?php
echo date("m/d/Y H:i:s", -2145888000)."\n";
//01/01/1902 00:00:00
echo strtotime("Jan 1 1902")."\n";
//-1
echo date("m/d/Y H:i:s", -631123200)."\n";
//01/01/1950 00:00:00
echo strtotime("Jan 1 1950")."\n";
//-1
echo date("m/d/Y H:i:s", 946713600)."\n";
//01/01/2000 00:00:00
echo strtotime("Jan 1 2000")."\n";
//946713600
?>
Expected result:
----------------
01/01/1902 00:00:00
-2145888000
01/01/1950 00:00:00
-631123200
01/01/2000 00:00:00
946713600
Actual result:
--------------
01/01/1902 00:00:00
-1
01/01/1950 00:00:00
-1
01/01/2000 00:00:00
946713600
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32270&edit=1