#27195 [Opn->Bgs]: strtotime problems
| From: | derick@php.net | Date: | Mon, 09 Feb 2004 17:33:01 +0000 |
| Subject: | #27195 [Opn->Bgs]: strtotime problems | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-54630@lists.php.net to get a copy of this message | ||
ID: 27195
Updated by: derick@php.net
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