ID:               44622
 User updated by:  mikel at mikelward dot com
 Reported By:      mikel at mikelward dot com
 Status:           Open
 Bug Type:         Date/time related
 Operating System: Linux
-PHP Version:      5.2.5
+PHP Version:      5.2.4
 New Comment:

Apparently PHP does include its own time zone database.

5.2.5 includes "2007.9".  What version of tzdata (if any) does this
correspond to?

Vendors will need to issue errata packages for PHP to address every
timezone change.  Certainly there's none for CentOS.

I will build my own 5.2.5 and see how it goes.


Previous Comments:
------------------------------------------------------------------------

[2008-04-02 23:58:03] mikel at mikelward dot com

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 this bug report at http://bugs.php.net/?id=44622&edit=1

Reply via email to