php.net |  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
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: ercanaydemir at hotmail dot com
New email:
PHP Version: OS:

 

 [2004-03-31 06:45 UTC] ercanaydemir at hotmail dot com
Description:
------------
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:
----------------
0
0


Actual result:
--------------
1
0


Patches

Pull Requests

History

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

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: Fri Dec 27 15:01:29 2024 UTC