php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27095 strtotime()
Submitted: 2004-01-30 04:05 UTC Modified: 2004-01-30 06:27 UTC
From: ozsvar at yahoo dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 4.3.4 OS: Linux, Windows
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ozsvar at yahoo dot com
New email:
PHP Version: OS:

 

 [2004-01-30 04:05 UTC] ozsvar at yahoo dot com
Description:
------------
I have found a bug at function strtotime().
When the system date is 30. January and I call strtotime with parameter: +1 month the result is wrong: March!!!


Reproduce code:
---------------
<?
  // If the system date is 2004-01-30

  echo date("Y-m", strtotime("+1 month"));

  // The result will be 2004-03 !!!!!!
?>

Expected result:
----------------
I expect 2004-02 !!!


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-30 04:16 UTC] ozsvar at yahoo dot com
My remark was wrong. I'm sorry. :(
 [2004-01-30 06:27 UTC] derick@php.net
Yup, there is no february 30th ;-)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 01 15:01:29 2024 UTC