|  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
 [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: Tue May 28 00:01:32 2024 UTC