#28594 [Com]: strtotime bug

From: Date: Tue, 01 Jun 2004 05:30:55 +0000
Subject: #28594 [Com]: strtotime bug
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-60230@lists.php.net to get a copy of this message
ID: 28594 Comment by: jed at jed dot bz Reported By: tavancini at hotmail dot com Status: Open Bug Type: Date/time related Operating System: Windows 2000 Server PHP Version: 4.3.6 New Comment: Better demonstration: for($x = 12; $x >= 1; $x--) echo date("m/Y", strtotime(sprintf("$x month%s ago", $x == 1 ? '' : 's'))) . "\n"; Odd assortment of dates. Previous Comments: ------------------------------------------------------------------------ [2004-05-31 23:17:45] tavancini at hotmail dot com Description: ------------ strtotime not calculating actual date subtraction Reproduce code: --------------- <? echo date( "m/Y", strtotime("-11 month") ) . "<br><br>"; echo date( "m/Y", strtotime("-10 month") ) . "<br><br>"; ?> Expected result: ---------------- 07/2003 08/2003 Actual result: -------------- 07/2003 07/2003 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28594&edit=1

« previous php.bugs (#60230) next »