|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-02-11 17:09 UTC] tony2001@php.net
[2006-02-11 17:32 UTC] geomouchet at yahoo dot com
[2006-02-12 09:19 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 18:00:01 2025 UTC |
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