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
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: 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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 09:01:32 2024 UTC