php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37056 timestamp problem
Submitted: 2006-04-12 13:59 UTC Modified: 2006-04-12 14:11 UTC
From: mpirhala at genesispo dot sk Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.1.2 OS: winxp, linux
Private report: No CVE-ID: None
 [2006-04-12 13:59 UTC] mpirhala at genesispo dot sk
Description:
------------
I make day's timestamps adding 1 day in seconds (86400s) to previous timestamp. I got strange result with 03/26/2006 and 03/27/2006. (tested on winxp and debian linux)

Reproduce code:
---------------
## 26.03.2006 00:00:00
$timestamp = 1143327600;
print date ("d.m.Y H:i:s", $timestamp)."<br>";

## add 1 day in seconds (86400)
$timestamp += 24 * 60 * 60; 
## should be 27.03.2006 00:00:00
## result is 27.03.2006 01:00:00
print date ("d.m.Y H:i:s", $timestamp)."<br>";


Expected result:
----------------
26.03.2006 00:00:00
27.03.2006 00:00:00

Actual result:
--------------
26.03.2006 00:00:00
27.03.2006 01:00:00

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-12 14:11 UTC] tony2001@php.net
We are happy to tell you that you just discovered Daylight Savings
Time. For more information see:
http://webexhibits.org/daylightsaving/b.html
Instead of using mktime/date consider using gmmktime and gmdate which do
not suffer from DST.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 16:01:30 2024 UTC