|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-03-07 19:05 UTC] derick@php.net
-Status: Open
+Status: Bogus
[2011-03-07 19:05 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 18:00:01 2025 UTC |
Description: ------------ It appears that strtotime misinterprets dates in formats like "1 Aug, 2005" or "2 Mar, 2008" for the 2000s. Dates in 1900s are unaffected. The month and day values are correctly interpreted, but the year is being set to the current instead of the correct value. Test script: --------------- strtotime('2 Mar, 2008');<br /> <?php print strtotime('2 Mar, 2008')?><br /> <br /> strtotime('2 Mar 2008');<br /> <?php print strtotime('2 Mar 2008')?><br /> <br /> strtotime('2 Mar, 1999');<br /> <?php print strtotime('2 Mar, 1999')?><br /> <br /> strtotime('2 Mar 1999');<br /> <?php print strtotime('2 Mar 1999')?><br /> Expected result: ---------------- strtotime should generate the same date for '2 Mar, 2008' as '2 Mar 2008'. Actual result: -------------- strtotime wrongly generates 1299114480 (2 Mar 2011) for '2 Mar, 2008' but correctly interprets 1204434000 for '2 Mar 2008'.