|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-06-18 16:23 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 12:00:02 2025 UTC |
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