PHP :: Bug #32270 :: strtotime/date behavior
| Bug #32270 | strtotime/date behavior | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2005-03-11 03:22 UTC | Modified: | 2005-06-18 16:23 UTC |
|
||||||||||
| From: | php at unfit dot org | Assigned: | derick (profile) | |||||||||||
| Status: | Closed | Package: | Date/time related | |||||||||||
| PHP Version: | 5.0.4, 4.3.11 | OS: | Linux 2.4.23 | |||||||||||
| Private report: | No | CVE-ID: | None | |||||||||||
[2005-03-11 03:22 UTC] 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
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2005-06-18 16:23 UTC] derick@php.net