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
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: mpirhala at genesispo dot sk
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Mon Jun 02 23:01:26 2025 UTC