From: mikel at mikelward dot com Operating system: Linux PHP version: 5.2.5 PHP Bug Type: Date/time related Bug description: Australia/Victoria timezone is wrong this week
Description: ------------ On PHP 5.1.6 and 5.2.4, strftime is returning the wrong information on my Linux systems in the Australia/Melbourne timezone. We recently had a change to the rules for daylight savings which extended daylight savings by one week from Sunday 30 March to Sunday 6 April. The operating system has handled this change fine (using tzdata 2007k), but PHP is wrongly reporting the timezone as UTC+10 instead of UTC+11. I have seen PHP default to Australia/Melbourne and Australia/ACT on various systems, but all of those will be at UTC+11 until this weekend. The only timezone that is correctly UTC+10 is Australia/Brisbane. Calling date_default_timezone_set('Australia/Melbourne') does not solve the problem. The attached code produces the following output: PHP time: 3 Apr 2008 9:48 shell time: 3 Apr 2008 10:48 It shows that the system's time and timezone is correct, but PHP is doing something whacky. Does it have its own tzdata? (And if so why?) Reproduce code: --------------- <?php date_default_timezone_set('Australia/Melbourne'); $user_datetime_format = "%e %b %Y %k:%M"; $now = time(); $current_time = strftime($user_datetime_format, $now); $offset = strftime("%z", $now); print("PHP time: $current_time\n<br>"); print("shell time: "); system("date \"+$user_datetime_format\""); ?> Expected result: ---------------- PHP time: 3 Apr 2008 10:48 shell time: 3 Apr 2008 10:48 Actual result: -------------- PHP time: 3 Apr 2008 9:48 shell time: 3 Apr 2008 10:48 -- Edit bug report at http://bugs.php.net/?id=44622&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44622&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44622&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44622&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=44622&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=44622&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=44622&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=44622&r=needscript Try newer version: http://bugs.php.net/fix.php?id=44622&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=44622&r=support Expected behavior: http://bugs.php.net/fix.php?id=44622&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=44622&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=44622&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=44622&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44622&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=44622&r=dst IIS Stability: http://bugs.php.net/fix.php?id=44622&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=44622&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=44622&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=44622&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=44622&r=mysqlcfg