Bug 187533 - strtotime Date Calculation Error - February
Summary: strtotime Date Calculation Error - February
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: php
Version: 5
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Joe Orton
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-03-31 18:35 UTC by David Hart
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-04-07 10:42:10 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description David Hart 2006-03-31 18:35:29 UTC
Description of problem:
Please note that PHP reports "not a bug." I disagree. This applies to both FC4
and FC5.

Version-Release number of selected component (if applicable):
php-5.1.2-5 and php-5.0.4-10.5

How reproducible:
If current date = March 30 or March 31:

     $lastmonth=date('Y-m',strtotime("-1 month 1 day"));
  
Actual results:

      2006-03

Expected results:

      2006-02

Comment 1 Joe Orton 2006-04-07 10:42:10 UTC
Thanks for the report.

The PHP strtotime interface aims to be compatible with the GNU "Date Input
Format" syntax, per the PHP strtotime manual page.  Under that syntax, the
behaviour implemented here is as expected; it even gives a similar case an example.

http://www.gnu.org/software/tar/manual/html_node/tar_115.html#SEC115

I cannot see any reason to disagree with the upstream response on this.


Note You need to log in before you can comment on or make changes to this bug.