From: daliuskal at gmail dot com
Operating system: CentOS release 5.9 (Final)
PHP version: 5.3.25
Package: *General Issues
Bug Type: Bug
Bug description:date_default_timezone_set('UTC') bug
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
--
Edit bug report at https://bugs.php.net/bug.php?id=64824&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=64824&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=64824&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=64824&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=64824&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=64824&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=64824&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=64824&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=64824&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=64824&r=support
Expected behavior: https://bugs.php.net/fix.php?id=64824&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=64824&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=64824&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=64824&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64824&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=64824&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=64824&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=64824&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64824&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=64824&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=64824&r=mysqlcfg