ID:               27195
 Updated by:       [EMAIL PROTECTED]
 Reported By:      sinner_zero at hotmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Date/time related
 Operating System: Linux 2.4.19
 PHP Version:      4.3.4
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Already reported before too, but it is correct like this.


Previous Comments:
------------------------------------------------------------------------

[2004-02-09 12:21:27] sinner_zero at hotmail dot com

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 this bug report at http://bugs.php.net/?id=27195&edit=1

Reply via email to