|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-07-21 14:42 UTC] aharvey@php.net
-Status: Open
+Status: Duplicate
[2011-07-21 14:42 UTC] aharvey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 13:00:02 2025 UTC |
Description: ------------ The behavior of strtotime() on 64 bit machines (see below) for all-zero timestamps is undesirable. On 32 bit machines the function outputs NULL for a string input "0000-00-00 00:00", on 64 bit machines it yields -62169987600. This is undesirable, as the all-zero timestamp is not a valid date ("00" is not a month). On 64 bit systems strtotime() should return NULL for "0000-00-00 00:00". Test script: --------------- /* Linux ubuntu64-vbox 2.6.38-8-server #42-Ubuntu SMP Mon Apr 11 03:49:04 UTC * 2011 x86_64 x86_64 x86_64 GNU/Linux * PHP 5.3.6-6~dotdeb.1 with Suhosin-Patch (cli) (built: Apr 3 2011 16:36:05) */ <?php echo strtotime("0000-00-00 00:00"); ?> Actual result: -------------- -62169987600