ID: 27793
Updated by: [EMAIL PROTECTED]
Reported By: henrik at mindlocker dot no
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: Mac OS X Server 10.3.3/Darwin7.3
PHP Version: 4.3.5
New Comment:
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same.
Thank you for your interest in PHP.
Already reported atleast *5* times.
Previous Comments:
------------------------------------------------------------------------
[2004-03-31 03:34:24] henrik at mindlocker dot no
Description:
------------
strtotime("- x month") will not work properly when
around a month change. The following code example was
run on 31.march. I have seen the previous bug reports
that indicate that month is really an alias for 30.5
days. However, this causes problems when you need to
correctly iterate (dynamically) with the month keyword.
It should iterate correctly when its specified as month,
if not my opinion is that implementations should use
strtotime("- ".$num*"30.5"." days");
Reproduce code:
---------------
for( $c=0;$c<12;$c++ )
echo date("F",strtotime("-".$c." month"))."<br>";
Expected result:
----------------
March
February
Januar
December
November
October
Actual result:
--------------
March
January
December
December
October
October
...
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27793&edit=1