|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27797 date function wrongly convert timestamps
Submitted: 2004-03-31 06:45 UTC Modified: 2004-03-31 07:43 UTC
From: ercanaydemir at hotmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 4.3.4 OS: Linux
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.
Block user comment
Status: Assign to:
Bug Type:
From: ercanaydemir at hotmail dot com
New email:
PHP Version: OS:


 [2004-03-31 06:45 UTC] ercanaydemir at hotmail dot com
The following example is relevant.
Two dates but with the same hour. Using the date function with the "G" option gives different results even if the hours are the same.

Reproduce code:
$D = mktime(0,0,0,3,29,2004,0);
$DM1 = mktime(0,0,0,3,28,2004,0);
echo "$D<br>$DM1<br>";
$Hour = date("G",$D);
$HourM1 = date("G",$DM1);
echo "$Hour<br>$HourM1";

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-31 07:43 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

This is working just fine. You pass a DST date while forcing to say that the date is not in DST; thus PHP adds an hour.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 26 17:01:31 2024 UTC