#18670 [Ana->Asn]: strtotime() bug
| From: | kalowsky@php.net | Date: | Wed, 31 Jul 2002 22:07:06 +0000 |
| Subject: | #18670 [Ana->Asn]: strtotime() bug | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-15720@lists.php.net to get a copy of this message | ||
ID: 18670
Updated by: kalowsky@php.net
Reported By: nic@bbmcarlson.com
-Status: Analyzed
+Status: Assigned
Bug Type: Date/time related
Operating System: RedHat Linux Linux linux1 2.2.16
PHP Version: 4.2.2
-Assigned To:
+Assigned To: rasmus
New Comment:
Assigning to rasmus as it sounds like he already knows whats wrong.
Previous Comments:
------------------------------------------------------------------------
[2002-07-31 10:51:09] kalowsky@php.net
so can we assign this bug to you Rasmus?
------------------------------------------------------------------------
[2002-07-31 10:44:11] rasmus@php.net
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.
------------------------------------------------------------------------
[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