From: mwu at oxid8 dot com Operating system: CentOS release 5.2 (Final) PHP version: 5.2.9 PHP Bug Type: Date/time related Bug description: strtotime("+1 wed",time()); doesn't work
Description: ------------ This worked prior to php 5.2.9 (at least its working in 5.2.6) strtotime("+1 Wed",time()) would yield a timestamp that is 1 Wednesday from the current time. So if the current date is Monday April 27,2009 3pm, then the resulting function would return May 6, 2009 3pm. in 5.2.9 executing this function returns the same timestamp. Reproduce code: --------------- function test($sInterval,$iNextDate) { echo "strtotime(\"$sInterval\",$iNextDate);<br/>"; echo $iNextDate = strtotime($sInterval,$iNextDate) . "<br/>"; echo $iNextDate = strtotime($sInterval,$iNextDate) . "<br/>"; echo $iNextDate = strtotime($sInterval,$iNextDate) . "<br/>"; echo "<br/>"; } $iNextDate = time(); test("+1 Wed",$iNextDate); test("+1 day",$iNextDate); test("+1 week",$iNextDate); Actual result: -------------- strtotime("+1 Wed",1240860865); 1240981200 1240981200 1240981200 strtotime("+1 day",1240860865); 1240947265 1241033665 1241120065 strtotime("+1 week",1240860865); 1241465665 1242070465 1242675265 -- Edit bug report at http://bugs.php.net/?id=48091&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48091&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48091&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48091&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=48091&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48091&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=48091&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=48091&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=48091&r=needscript Try newer version: http://bugs.php.net/fix.php?id=48091&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=48091&r=support Expected behavior: http://bugs.php.net/fix.php?id=48091&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=48091&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=48091&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=48091&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48091&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=48091&r=dst IIS Stability: http://bugs.php.net/fix.php?id=48091&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=48091&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=48091&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=48091&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=48091&r=mysqlcfg