From: mvitnellml at swiftdsl dot com dot au
Operating system: Linux Debian etch
PHP version: 5CVS-2005-12-21 (snap)
PHP Bug Type: Date/time related
Bug description: date_default_timezone_get() returns wrong city and timezone
for Australia
Description:
------------
The following session shows date_default_timezone_get() returning the
wrong city (Melbourne instead of Sydney) but more importantly, the wrong
city AND timezone (ACT instead of Brisbane):
Script started on Thu 22 Dec 2005 01:17:56 EST
theta:/usr/local/php5.1-200512211130# uname -a
Linux theta.sinusoid.com 2.6.14.2 #1 SMP Tue Nov 22 15:09:19 EST 2005 i686
GNU/Linux
theta:/usr/local/php5.1-200512211130# php -v
PHP 5.1.2-dev (cli) (built: Dec 21 2005 23:35:51)
Copyright (c) 1997-2005 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2005 Zend Technologies
theta:/usr/local/php5.1-200512211130# cat printzone.php
<?php
echo date_default_timezone_get(),"\n";
?>
theta:/usr/local/php5.1-200512211130# cat /etc/timezone
Australia/Sydney
theta:/usr/local/php5.1-200512211130# php printzone.php
Australia/Melbourne
theta:/usr/local/php5.1-200512211130# tzconfig
Your current time zone is set to Australia/Sydney
Do you want to change that? [n]: y
Please enter the number of the geographic area in which you live:
1) Africa 7) Australia
2) America 8) Europe
3) US time zones 9) Indian Ocean
4) Canada time zones 10) Pacific Ocean
5) Asia 11) Use System V style time zones
6) Atlantic Ocean 12) None of the above
Then you will be shown a list of cities which represent the time zone
in which they are located. You should choose a city in your time zone.
Number: 7
ACT Adelaide Brisbane Broken_Hill Canberra Darwin Hobart LHI Lindeman
Lord_Howe Melbourne North NSW Perth Queensland South Sydney Tasmania
Victoria West Yancowinna
Please enter the name of one of these cities or zones
You just need to type enough letters to resolve ambiguities
Press Enter to view all of them again
Name: [] Brisbane
Your default time zone is set to 'Australia/Brisbane'.
Local time is now: Thu Dec 22 00:19:08 EST 2005.
Universal Time is now: Wed Dec 21 14:19:08 UTC 2005.
theta:/usr/local/php5.1-200512211130# php printzone.php
Australia/ACT
theta:/usr/local/php5.1-200512211130# cat /etc/timezone
Australia/Brisbane
theta:/usr/local/php5.1-200512211130# exit
configure line was ./configure --with-apxs2=/usr/local/apache2/bin/apxs
(which was apache 2.0.53)
Reproduce code:
---------------
<?php
echo date_default_timezone_get(),"\n";
?>
Expected result:
----------------
The correct timezone returned, and preferably the city that has been set
as the timezone for the operating system.
Actual result:
--------------
Australia/Melbourne returned, which while currently in the same timezone
as Australia/Sydney, has in the past had slightly different daylight
saving start/finish times.
Australia/ACT returned for a set system timezone of Australia/Brisbane,
which are in different timezones, and are 1 hour different during daylight
saving.
--
Edit bug report at http://bugs.php.net/?id=35763&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=35763&r=trysnapshot44
Try a CVS snapshot (PHP 5.1):
http://bugs.php.net/fix.php?id=35763&r=trysnapshot51
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=35763&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=35763&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=35763&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35763&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35763&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35763&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35763&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35763&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=35763&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=35763&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35763&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35763&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35763&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35763&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35763&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35763&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35763&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35763&r=mysqlcfg