#37772 [Fbk->Opn]: The GMT time actually shows UTC time

From: Date: Mon, 12 Jun 2006 09:07:51 +0000
Subject: #37772 [Fbk->Opn]: The GMT time actually shows UTC time
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-98287@lists.php.net to get a copy of this message
ID: 37772 User updated by: rosty dot kerei at gmail dot com Reported By: rosty dot kerei at gmail dot com -Status: Feedback +Status: Open Bug Type: Date/time related Operating System: Windows PHP Version: 5.1.4 New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [2006-06-09 23:09:54] 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-09 23:01:32] 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 21:50:42] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37772&edit=1

« previous php.bugs (#98287) next »