From: mgs at au dot ru
Operating system: Linux, Win-XP
PHP version: 5.2.0
PHP Bug Type: Date/time related
Bug description: Strange behaviour of gmmktime
Description:
------------
In php4 this piece of code (except date_default_timezone_get) works
properly (gmtime was localtime+3(Hours)) but since date/time block was
rewritten (and date_default_timezone_get is born which is happen
~PHP5.1.0) mktime and gmmktime both return the same value and
date_default_timezone_get returns "Europe/Moscow".
What can be wrong?
Reproduce code:
---------------
<?php
$timelocal=mktime();
$timegm=gmmktime();
echo "local=$timelocal\n";
echo "gm =$timegm\n";
echo "local=".date("d-m-Y H:i:s",$timelocal);
echo "\n";
echo "gm =".date("d-m-Y H:i:s",$timegm);
echo "\n";
echo date_default_timezone_get()."\n";
?>
Expected result:
----------------
local=1164979830
gm =1164990643
local=01-12-2006 16:30:30
gm =01-12-2006 19:30:30
Europe/Moscow
Actual result:
--------------
local=1164979830
gm =1164979830
local=01-12-2006 16:30:30
gm =01-12-2006 16:30:30
Europe/Moscow
--
Edit bug report at http://bugs.php.net/?id=39701&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=39701&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=39701&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=39701&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=39701&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=39701&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=39701&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=39701&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=39701&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=39701&r=support
Expected behavior: http://bugs.php.net/fix.php?id=39701&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=39701&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=39701&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=39701&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39701&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=39701&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=39701&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=39701&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=39701&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=39701&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=39701&r=mysqlcfg