#39309 [NEW]: strtotime function bug

From: Date: Mon, 30 Oct 2006 15:23:33 +0000
Subject: #39309 [NEW]: strtotime function bug
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-104184@lists.php.net to get a copy of this message
From: thebogu at gmail dot com Operating system: Windows XP SP2 PHP version: 4.4.4 PHP Bug Type: Date/time related Bug description: strtotime function bug Description: ------------ I tried a little script that parse all days since a certain date till today, I get an infinite loop and after I debug the script I notice that for 2006-03-25 if I use strtotime("+1 day") to get to the next day it don't calculate the day correctly. I'll the testing script below ... Before reporting this bug I test this function under php 4.4.2 and php 4.4.4 under linux and is working corectly, the only problem I could think of is the php 4.4.4 win vers ... Reproduce code: --------------- <?php $time = "2006-03-25"; echo date("Y-m-d H:i:s",strtotime($time))."<br>"; echo date("Y-m-d H:i:s",strtotime("+1 day",strtotime($time)))."<br>"; ?> Expected result: ---------------- 2006-03-25 00:00:00 2006-03-26 00:00:00 Actual result: -------------- 2006-03-25 00:00:00 2006-03-25 23:00:00 -- Edit bug report at http://bugs.php.net/?id=39309&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39309&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39309&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39309&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39309&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39309&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39309&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=39309&r=needscript Try newer version: http://bugs.php.net/fix.php?id=39309&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39309&r=support Expected behavior: http://bugs.php.net/fix.php?id=39309&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39309&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39309&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39309&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39309&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39309&r=dst IIS Stability: http://bugs.php.net/fix.php?id=39309&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39309&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39309&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39309&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=39309&r=mysqlcfg

« previous php.bugs (#104184) next »