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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Thu Nov 27 09:00:01 2025 UTC