| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2008-04-03 00:31 UTC] mikel at mikelward dot com
  [2008-04-03 01:02 UTC] mikel at mikelward dot com
  | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 05:00:01 2025 UTC | 
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