php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37772 The GMT time actually shows UTC time
Submitted: 2006-06-09 21:50 UTC Modified: 2006-06-12 10:26 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: rosty dot kerei at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.1.4 OS: Windows
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: rosty dot kerei at gmail dot com
New email:
PHP Version: OS:

 

 [2006-06-09 21:50 UTC] rosty dot kerei at gmail dot com
Description:
------------
The function gmdate() actually returns UTC time instead of GMT and it's different on summer time (GMT = UTC+1 hour). Learn more here:
http://en.wikipedia.org/wiki/GMT
http://en.wikipedia.org/wiki/UTC

For example, now I'm situated in Kiev, Ukraine (GMT+2), it's summer time and it's 04:00AM here, but in London (in GMT zone) it's 02:00AM, however the function returns 01:00AM - it's not GMT, it's UTC time. This function should work well in winter.

Reproduce code:
---------------
<?php
	echo gmdate('H:i', time());
?>

Expected result:
----------------
02:00AM



Actual result:
--------------
01:00AM

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-09 23:01 UTC] derick@php.net
Paste the output of the following script please:

<?php
echo date_default_timezone_get(), "\n";
echo date(DATE_RFC2822. " T e Z"), "\n";
echo gmdate(DATE_RFC2822. " T e Z"), "\n";

date_default_timezone_set('Europe/Kiev');
echo date_default_timezone_get(), "\n";
echo date(DATE_RFC2822. " T e Z"), "\n";
echo gmdate(DATE_RFC2822. " T e Z"), "\n";
?>

 [2006-06-09 23:09 UTC] judas dot iscariote at gmail dot comn
test returns here :

America/Santiago
Fri, 09 Jun 2006 19:08:00 -0400 CLT America/Santiago -14400
Fri, 09 Jun 2006 23:08:00 +0000 GMT UTC 0
Europe/Kiev
Sat, 10 Jun 2006 02:08:00 +0300 EEST Europe/Kiev 10800
Fri, 09 Jun 2006 23:08:00 +0000 GMT UTC 0

current PHP_5_2
 [2006-06-12 09:07 UTC] rosty dot kerei at gmail dot com
PHP 5.1.1:

Europe/Kiev
Mon, 12 Jun 2006 12:05:56 +0300 EEST Europe/Kiev 10800
Mon, 12 Jun 2006 09:05:56 +0000 GMT UTC 0
Europe/Kiev
Mon, 12 Jun 2006 12:05:56 +0300 EEST Europe/Kiev 10800
Mon, 12 Jun 2006 09:05:56 +0000 GMT UTC 0
 [2006-06-12 10:26 UTC] mgf@php.net
@rosty.kerei: There's a fundamental error in your original report, as GMT is never UTC+1: GMT effectively *is* UTC.  Here in the UK right now, we're on British Summer Time (BST, UTC+1, GMT+1), so London, although in a "GMT zone", is not currently on GMT. In the autumn, we will shift back an hour and London will then indeed be on GMT.

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Aug 13 13:00:03 2025 UTC