|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-07-03 06:52 UTC] tony2001@php.net
[2007-07-05 13:51 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 20:00:01 2025 UTC |
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