php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33563 strtotime('+1 month',$abc) cant get right time
Submitted: 2005-07-04 14:30 UTC Modified: 2005-07-04 14:41 UTC
From: hufan at baidu dot com Assigned:
Status: Closed Package: Date/time related
PHP Version: 5.1.0b2 OS: redhat7.3
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: hufan at baidu dot com
New email:
PHP Version: OS:

 

 [2005-07-04 14:30 UTC] hufan at baidu dot com
Description:
------------
strtotime('+1 month',$abc) cant get right time

Reproduce code:
---------------
<?
$strCurrDate = date('Y-m-d H:i:s',strtotime('2005-06-30 21:04:23'));
$strMonAfter = date('Y-m-d H:i:s',strtotime('+1 month',strtotime($strCurrDate)));

echo "strCurrDate:$strCurrDate strMonAfter:$strMonAfter";
?>


Expected result:
----------------
should be??
strCurrDate:2005-07-01 05:04:23 strMonAfter:2005-08-01 05:04:23

Actual result:
--------------
strCurrDate:2005-07-01 05:04:23 strMonAfter:2005-08-01 13:04:23


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-04 14:38 UTC] derick@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip
 [2005-07-04 14:41 UTC] derick@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 22:01:31 2024 UTC