|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27195 strtotime problems
Submitted: 2004-02-09 12:21 UTC Modified: 2004-02-09 12:33 UTC
From: sinner_zero at hotmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 4.3.4 OS: Linux 2.4.19
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: sinner_zero at hotmail dot com
New email:
PHP Version: OS:


 [2004-02-09 12:21 UTC] sinner_zero at hotmail dot com
Calling strtotime("-1 month",$date)
$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:
$date = date("2004-03-30");

$previousMonth = date("Y-m-d",strtotime("-1 month",strtotime($date)));

echo $previousMonth;

Expected result:

?? could be anything between 01 and 29.

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-09 12:33 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

Already reported before too, but it is correct like this.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 07:01:31 2024 UTC