ID: 34898 Updated by: [EMAIL PROTECTED] Reported By: alancox+php at gmail dot com -Status: Feedback +Status: Bogus Bug Type: Date/time related Operating System: Debian Sarge PHP Version: 5.0.5 New Comment:
No bug here. 1. you used the "t" modifier where you should have used "d" 2. There is no november 31st, so that get's rounded up to december 1st Previous Comments: ------------------------------------------------------------------------ [2005-10-17 22:24:25] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip ------------------------------------------------------------------------ [2005-10-17 22:21:14] alancox+php at gmail dot com Description: ------------ The strtotime function doesn't always add one month when you ask it to. Reproduce code: --------------- $date = "2005-10-31 23:59:59"; echo date( "Y-m-t H:i:s", strtotime( "+1 month", strtotime($date) ) ); // 2005-12-31 23:59:59 $date = "2005-10-30 23:59:59"; echo date( "Y-m-t H:i:s", strtotime( "+1 month", strtotime($date) ) ); // 2005-11-30 23:59:59 Expected result: ---------------- Both echos should be 2005-11-30 23:59:59. The first one is incorrect. Actual result: -------------- 2005-12-31 23:59:592005-11-30 23:59:59 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34898&edit=1