|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-08-05 02:43 UTC] kris dot craig at gmail dot com
Description: ------------ Any time I enter a date (any format) into strtotime that contains a year later than 2037, the function returns FALSE every time. If I change the year to 2037 or earler, without changing anything else, it works every time. I have not been able to find any documentation or other information to explain this phenomenon. Pertinent server/module/etc information can be found here: http://www.kriscraig.com/phpinfo.php Reproduce code: --------------- /* This could not be simpler.... */ print strtotime( "2012-05-06" ); //1336287600 (works) print strtotime( "12 May 2037" ); //2125724400 (works) print strtotime( "12 May 2038" ); // (doesn't work!) print strtotime( "2500-05-06" ); // (doesn't work!) Expected result: ---------------- They should all return a valid timestamp. FALSE should only be returned if it fails, which is not supposed to happen simply because the year being input is greater than 2037! Actual result: -------------- It returns FALSE. Nothing. Nada. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 26 05:00:01 2025 UTC |
Derick has given you a solution, use the new DateTime class. $date = new DateTime("12 May 2038"); echo $date->format("U");