|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-05-12 21:14 UTC] daliuskal at gmail dot com
-Status: Open
+Status: Closed
[2013-05-12 21:14 UTC] daliuskal at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 22:00:02 2025 UTC |
Description: ------------ date_default_timezone_set('UTC') is not working as expected, date function returns time with -14400 seconds (-4 hours) from UTC. I've run into this problem after moving into new server, had to set default timezone to GMT instead of UTC for the code to work correctly. Test script: --------------- $time = time(); date_default_timezone_set('UTC'); echo (date('h', $time) - gmdate('h', $time)); date_default_timezone_set('GMT'); echo "\n".(date('h', $time) - gmdate('h', $time)); Expected result: ---------------- 0 0 Actual result: -------------- -4 0