#18670 [Ana]: strtotime() bug

From: Date: Wed, 31 Jul 2002 14:44:12 +0000
Subject: #18670 [Ana]: strtotime() bug
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-15685@lists.php.net to get a copy of this message
ID: 18670 Updated by: rasmus@php.net Reported By: nic@bbmcarlson.com Status: Analyzed Bug Type: Date/time related Operating System: RedHat Linux Linux linux1 2.2.16 PHP Version: 4.2.2 New Comment: Sebastian, yes, that is because I changed how "next" works based on bug report #18655 It works correctly for days now, but it does seem like month-handling is messed up now. Previous Comments: ------------------------------------------------------------------------ [2002-07-31 10:39:10] rasmus@php.net The problem is that it adds a full month to the current timestamp. So you end up getting the 31st of the next month and some months do not have 31 days. I'll need to do some reading to determine if strtotime() is supposed to pick the beginning of the next month instead, or perhaps the middle. ------------------------------------------------------------------------ [2002-07-31 10:38:50] nohn@php.net Strange... With PHP4.3.0-dev-200207300000 on Compaq Tru64 the output is "July October December". ------------------------------------------------------------------------ [2002-07-31 10:26:00] nic@bbmcarlson.com I have some code: $nextmonth = strtotime("next month"); $monthafter = strtotime("next month",$nextmonth") ; $monthOne = date("F") ; $monthTwo=date("F",$nextmonth) ; $monthThree=date("F",$monthafter) ; Today is July 31 2002. I have the code: print($monthOne) ; print($monthTwo) ; print($monthThree) ; It prints: July, August, October I expect it to print: July, August, September ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18670&edit=1

« previous php.bugs (#15685) next »