From: jeremy at techtrav dot com Operating system: Windows XP Apache 2 PHP version: 5.1.0b3 PHP Bug Type: Date/time related Bug description: Strtotime no longer parses +1day or +1year etc...
Description: ------------ the newest snap of php 5.1.X does not parse strtotime properly for adding days. This used to work in 5.0.4. Look at the reproduceable code below. The new version only seems to work with a space between the number and the days or months or years. Reproduce code: --------------- $date = strtotime('20 Aug'); echo date('m/d/Y H:m:s', strtotime('+5days',$date)); echo '<br>'; echo date('m/d/Y H:m:s', strtotime('+1month',$date)); echo '<br>'; echo date('m/d/Y H:m:s', strtotime('+1year',$date)); Expected result: ---------------- 08/25/2005 00:08:00 09/20/2005 00:09:00 08/20/2006 00:08:00 Actual result: -------------- 01/01/1970 00:01:00 01/01/1970 00:01:00 01/01/1970 00:01:00 -- Edit bug report at http://bugs.php.net/?id=33869&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33869&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33869&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33869&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=33869&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=33869&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=33869&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=33869&r=needscript Try newer version: http://bugs.php.net/fix.php?id=33869&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=33869&r=support Expected behavior: http://bugs.php.net/fix.php?id=33869&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=33869&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=33869&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=33869&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33869&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=33869&r=dst IIS Stability: http://bugs.php.net/fix.php?id=33869&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=33869&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=33869&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=33869&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=33869&r=mysqlcfg