From: sinner_zero at hotmail dot com
Operating system: Linux 2.4.19
PHP version: 4.3.4
PHP Bug Type: Date/time related
Bug description: strtotime problems
Description:
------------
Calling strtotime("-1 month",$date)
when
$date = march 30th
returns March 1st instead of february 30th (which actually doesn't exist
in 2004), I would assume this means it should return February 29th or
something close.
Reproduce code:
---------------
<?php
$date = date("2004-03-30");
$previousMonth = date("Y-m-d",strtotime("-1 month",strtotime($date)));
echo $previousMonth;
?>
Expected result:
----------------
2004-02-??
?? could be anything between 01 and 29.
Actual result:
--------------
2004-03-01
--
Edit bug report at http://bugs.php.net/?id=27195&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27195&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27195&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=27195&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=27195&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=27195&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=27195&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=27195&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=27195&r=support
Expected behavior: http://bugs.php.net/fix.php?id=27195&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=27195&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=27195&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=27195&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27195&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=27195&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=27195&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=27195&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27195&r=float