php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29502 gmmiketime() does not behave like GMT
Submitted: 2004-08-03 08:05 UTC Modified: 2004-08-03 09:22 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (50.0%)
From: ticoroman at msn dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: Irrelevant OS: Windows XP
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: ticoroman at msn dot com
New email:
PHP Version: OS:

 

 [2004-08-03 08:05 UTC] ticoroman at msn dot com
Description:
------------
I'm trying to use gmmktime() to convert a string (from database) containing date and time to managable date.

When the time (in the string) is 02:00:00 28 mars 2004 it's getting strange!

The error only occurs when the hour is 2, which is exactly when Daylight Saving Time should start in UTC+0100. When using 01:00:00 and 03:00:00 it works just fine. I consider this a bug, cause it make no sense.


Shortly:

The date from the database is saved in GMT-time and I want to KEEP IT that way. The reason I have to use gmmktime() is because of further necessary adjustments of the date!

Reproduce code:
---------------
<?php

echo "<br>1. ";
echo gmdate("Y-m-d H:i:s", gmmktime(02, 0, 0, 3, 27, 2004));
echo "<br>2. ";
echo gmdate("Y-m-d H:i:s", gmmktime(02, 0, 0, 3, 28, 2004));
echo "<br>3. ";
echo gmdate("Y-m-d H:i:s", gmmktime(02, 0, 0, 3, 29, 2004));
echo "<br>";

?>

Expected result:
----------------
1. 2004-03-27 02:00:00
2. 2004-03-28 02:00:00
3. 2004-03-29 02:00:00

Actual result:
--------------
1. 2004-03-27 02:00:00
2. 2004-03-28 01:00:00
3. 2004-03-29 02:00:00

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-03 09:11 UTC] ticoroman at msn dot com
This was confusing. By applying the 7th argument to gmmktime() I got it working like it should [at least it seems like that now]!

Even though I litterally RTFM from the start to the end I unfortunately never noticed the 7th argument. I deeply apologize as the whole thing turned out to be bogus. :(

Greetings,
Tico
 [2004-08-03 09:22 UTC] derick@php.net
Sorry, this is a bug in Windows and we can't fix that. PHP 5.1 will have non-OS-dependant date routines so it'll be fixed there.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 23:01:31 2025 UTC