From:             geomouchet at yahoo dot com
Operating system: Linux 2.6.14.2
PHP version:      4.4.2
PHP Bug Type:     Date/time related
Bug description:  gmmktime() returns GMT offset in wrong direction

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 bug report at http://bugs.php.net/?id=36367&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=36367&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=36367&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=36367&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=36367&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=36367&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=36367&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=36367&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=36367&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=36367&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=36367&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=36367&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=36367&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=36367&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36367&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=36367&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=36367&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=36367&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36367&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=36367&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=36367&r=mysqlcfg

Reply via email to