#35983 [NEW]: strtotime(string, now) behavior has changed

From: Date: Thu, 12 Jan 2006 18:51:13 +0000
Subject: #35983 [NEW]: strtotime(string, now) behavior has changed
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-91807@lists.php.net to get a copy of this message
From: tim at komta dot com Operating system: Windows XP Pro, Server 2003 PHP version: 5.1.2 PHP Bug Type: Date/time related Bug description: strtotime(string, now) behavior has changed Description: ------------ Prior to PHP 5.1.2 (potentially earlier, just only noticed it) strtotime(), when used with the optional 'now' argument, would return the time using the full 'now'. Now it returns 00:00 on the date of the 'now', ignoring hours, minutes, and seconds. Reproduce code: --------------- $this_morning = strtotime('today 00:00:00'); $tonight = strtotime('today 23:59:59'); echo date('m/d Hi', strtotime('yesterday', $this_morning)).'<br/>'; echo date('m/d Hi', strtotime('yesterday', $tonight)).'<br/>'; Expected result: ---------------- (as of 2005-01-12): 01/11 0000 01/11 2359 Actual result: -------------- (as of 2005-01-12): 01/11 0000 01/11 0000 -- Edit bug report at http://bugs.php.net/?id=35983&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=35983&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=35983&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=35983&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=35983&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=35983&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=35983&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=35983&r=needscript Try newer version: http://bugs.php.net/fix.php?id=35983&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=35983&r=support Expected behavior: http://bugs.php.net/fix.php?id=35983&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=35983&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=35983&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=35983&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35983&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=35983&r=dst IIS Stability: http://bugs.php.net/fix.php?id=35983&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=35983&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=35983&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=35983&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=35983&r=mysqlcfg

« previous php.bugs (#91807) next »