Bug #69408 [NEW]: Date strings consisting of year > 1999 not properly parsed

From: Date: Thu, 09 Apr 2015 15:38:37 +0000
Subject: Bug #69408 [NEW]: Date strings consisting of year > 1999 not properly parsed
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191920@lists.php.net to get a copy of this message
From: jkronika at gridlined dot com Operating system: Ubuntu PHP version: 5.5.23 Package: Date/time related Bug Type: Bug Bug description:Date strings consisting of year > 1999 not properly parsed Description: ------------ When parsing strings containing only a year, it appears that certain ranges of years do not get parsed appropriately. This is a cause, at least in my case, of very difficult to debug errors. Test script: --------------- echo var_export(date_parse('1999'), true)."\n\n"; echo var_export(date_parse('2001'), true); Expected result: ---------------- array ( 'year' => 1999, 'month' => false, 'day' => false, 'hour' => false, 'minute' => false, 'second' => false, ... ) array ( 'year' => 2001, 'month' => false, 'day' => false, 'hour' => false, 'minute' => false, 'second' => false, ... ) Actual result: -------------- array ( 'year' => 1999, 'month' => false, 'day' => false, 'hour' => false, 'minute' => false, 'second' => false, ... ) array ( 'year' => false, 'month' => false, 'day' => false, 'hour' => 20, 'minute' => 1, 'second' => 0, ... ) -- Edit bug report at https://bugs.php.net/bug.php?id=69408&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69408&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69408&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69408&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=69408&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=69408&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=69408&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=69408&r=needscript Try newer version: https://bugs.php.net/fix.php?id=69408&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=69408&r=support Expected behavior: https://bugs.php.net/fix.php?id=69408&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=69408&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=69408&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=69408&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69408&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=69408&r=dst IIS Stability: https://bugs.php.net/fix.php?id=69408&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=69408&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=69408&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=69408&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=69408&r=mysqlcfg

« previous php.bugs (#191920) next »