#33920 [Opn]: Wrong shows hour
| From: | php-work at yandex dot ru | Date: | Fri, 29 Jul 2005 20:48:49 +0000 |
| Subject: | #33920 [Opn]: Wrong shows hour | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-82707@lists.php.net to get a copy of this message | ||
ID: 33920
User updated by: php-work at yandex dot ru
Reported By: php-work at yandex dot ru
Status: Open
Bug Type: Date/time related
Operating System: Windows XP SP2
PHP Version: 5CVS-2005-07-29 (dev)
New Comment:
Sorry, on PHP5.0.4
Previous Comments:
------------------------------------------------------------------------
[2005-07-29 22:45:59] php-work at yandex dot ru
And else. I tried it (echo date('H');) on PHP5.0.4b3 and result is
true, 00....
------------------------------------------------------------------------
[2005-07-29 22:43:22] php-work at yandex dot ru
I has tried date_default_timezone_set('GMT'), but no result.
date_default_timezone_get return UTC. If add the
date_default_timezone_set('GMT'), return GMT.
Script:
<?php
date_default_timezone_set('GMT');
echo date_default_timezone_get();
echo date('H');
?>
print GMT20 (but current time - 00:42).
------------------------------------------------------------------------
[2005-07-29 20:00:43] nlopess@php.net
Probably your TZ environment var is set to GMT.
So, you need to use the date_default_timezone_set() function to overide
it.
------------------------------------------------------------------------
[2005-07-29 19:22:54] php-work at yandex dot ru
Tried, no effect.
------------------------------------------------------------------------
[2005-07-29 18:14:20] sniper@php.net
Set the timezone in php.ini using date.timezone setting.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/33920
--
Edit this bug report at http://bugs.php.net/?id=33920&edit=1