#34898 [Opn->Fbk]: strtotime

From: Date: Mon, 17 Oct 2005 20:24:27 +0000
Subject: #34898 [Opn->Fbk]: strtotime
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-86668@lists.php.net to get a copy of this message
ID: 34898 Updated by: tony2001@php.net Reported By: alancox+php at gmail dot com -Status: Open +Status: Feedback Bug Type: Date/time related Operating System: Debian Sarge PHP Version: 5.0.5 New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#86668) next »