|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-12-01 19:24 UTC] iliaa@php.net
[2006-12-02 06:13 UTC] mgs at au dot ru
[2006-12-02 06:15 UTC] mgs at au dot ru
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 19:00:01 2025 UTC |
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