#36367 [Opn->Csd]: gmmktime() returns GMT offset in wrong direction
| From: | sniper@php.net | Date: | Sun, 12 Feb 2006 08:19:30 +0000 |
| Subject: | #36367 [Opn->Csd]: gmmktime() returns GMT offset in wrong direction | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-93169@lists.php.net to get a copy of this message | ||
ID: 36367
Updated by: sniper@php.net
Reported By: geomouchet at yahoo dot com
-Status: Open
+Status: Closed
Bug Type: Date/time related
Operating System: Linux 2.6.14.2
PHP Version: 4.4.2
New Comment:
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at
http://www.php.net/downloads.php
Previous Comments:
------------------------------------------------------------------------
[2006-02-11 17:32:47] geomouchet at yahoo dot com
I don't have my own web server. I'm using PHP at a web host. Can you
try it on the latest build with the sample code I provided?
------------------------------------------------------------------------
[2006-02-11 17:09:02] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.1-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.1-win32-latest.zip
------------------------------------------------------------------------
[2006-02-11 17:05:21] geomouchet at yahoo dot com
Description:
------------
gmmktime() without any parameters returns the wrong time. My time zone
is GMT-8, so gmmktime() should be local time PLUS 8 hours. Instead it
returns local time minus 8 hours. This is different from the
DST/summer time problem previously reported.
My expected/actuals results are from a server on Pacific Time, but I
also tried this on a web host in Hong Kong (ICDSoft), running PHP 4.4.2
and GMT is similarly offset in the wrong direction from Hong Kong local
time.
Reproduce code:
---------------
echo "<p> PHP version: " . phpversion() . "</p>";
echo "<p>server time=" . date( "m/d/Y g:i A" )
. " " . mktime()
. " server GMT=" . date( "m/d/Y g:i A", gmmktime() )
. " " . gmmktime()
. " time zone setting=GMT" . date("O"). "</p>";
Expected result:
----------------
PHP version: 4.4.2
server time=02/11/2006 7:58 AM 1139702295 server GMT=02/11/2006 03:58
PM 1139644695 time zone setting=GMT-0800
Actual result:
--------------
PHP version: 4.4.2
server time=02/11/2006 7:58 AM 1139673495 server GMT=02/10/2006 11:58
PM 1139644695 time zone setting=GMT-0800
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36367&edit=1