ID: 41869 Updated by: [EMAIL PROTECTED] Reported By: gnupun at yahoo dot com Status: Assigned Bug Type: Date/time related Operating System: windows xp PHP Version: 5.2.3 Assigned To: derick New Comment:
I updated the timezone database (you can use it by installing the timezonedb extension from PECL). However the following statement is *correct* behavior: Eg: Etc/GMT+1 returns time 1 hour before Etc/GMT Similarly, Etc/GMT-1 returns time 1 hour after Etc/GMT This is how the timezone database does it - however, please try to avoid using timezones like this as they do not take care of DST and the like. Previous Comments: ------------------------------------------------------------------------ [2007-07-03 06:52:18] [EMAIL PROTECTED] Derick, looks like the timezone DB needs an update. ------------------------------------------------------------------------ [2007-07-02 07:44:57] gnupun at yahoo dot com Description: ------------ PHP returns incorrect time for the following timezones: America/Port-au-Prince Etc/GMT+* Etc/GMT-* where * is a digit 1-9. Eg: Etc/GMT+1 returns time 1 hour before Etc/GMT Similarly, Etc/GMT-1 returns time 1 hour after Etc/GMT Reproduce code: --------------- function print_current_time($timezone) { date_default_timezone_set($timezone); $s = strftime("%I:%M:%S %p %d %B %Y"); printf("%20s: %s\n", $timezone, $s); } print_current_time('America/Port-au-Prince'); print_current_time('Etc/GMT'); print_current_time('Etc/GMT+1'); print_current_time('Etc/GMT-1'); Expected result: ---------------- America/Port-au-Prince: 02:36:53 AM 02 July 2007 Etc/GMT: 07:36:53 AM 02 July 2007 Etc/GMT+1: 08:36:53 AM 02 July 2007 Etc/GMT-1: 06:36:53 AM 02 July 2007 Actual result: -------------- America/Port-au-Prince: 03:36:53 AM 02 July 2007 Etc/GMT: 07:36:53 AM 02 July 2007 Etc/GMT+1: 06:36:53 AM 02 July 2007 Etc/GMT-1: 08:36:53 AM 02 July 2007 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41869&edit=1