php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34618 unexpected strtotime output
Submitted: 2005-09-23 17:30 UTC Modified: 2005-09-23 17:40 UTC
From: technophreak at gammae dot com Assigned:
Status: Closed Package: Date/time related
PHP Version: 5.0.5 OS: fedora code 2
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: technophreak at gammae dot com
New email:
PHP Version: OS:

 

 [2005-09-23 17:30 UTC] technophreak at gammae dot com
Description:
------------
Some dates does not output properly with strtotime()

Works fine on PHP 4.3

Reproduce code:
---------------
$date = "2005-10-30 01:00:00";
$format = "Y-m-d H:i:s";

print date($format,strtotime("1 hour",strtotime($date)))."\n"; 

print date($format,strtotime("2 hour",strtotime($date)))."\n";



Expected result:
----------------
2005-10-30 02:00:00
2005-10-30 03:00:00

Actual result:
--------------
2005-10-30 01:00:00
2005-10-30 02:00:00

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-23 17:40 UTC] marcot@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.

Works for me on current CVS in the 5_1 branch.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 14 23:01:34 2025 UTC