SitePoint Sponsor

User Tag List

Results 1 to 20 of 20
  1. #1
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Handling Time Zones and DST in PHP

    I'm struggling with the right way to handle time zones in PHP.

    I have data being recorded in GMT, and I'd like to display it in each website user's local time. They would select a time zone at registration so that I can do the appropriate conversion.

    But how do I present the list of time zones for selection? PHP 5.2's timezone_abbreviations_list() returns a massive list. I compiled and sorted it by GMT offset and get this:

    Code:
    Array
    (
        [-12] => Array
            (
                [0] => Pacific/Kwajalein
                [1] => Kwajalein
            )
    
        [-11] => Array
            (
                [0] => America/Adak
                [1] => America/Atka
                [2] => America/Nome
                [3] => Pacific/Midway
                [4] => Pacific/Pago_Pago
                [5] => Pacific/Samoa
                [6] => US/Aleutian
                [7] => US/Samoa
                [8] => America/Adak
                [9] => America/Atka
                [10] => America/Nome
                [11] => Pacific/Midway
                [12] => Pacific/Pago_Pago
                [13] => Pacific/Samoa
                [14] => US/Aleutian
                [15] => US/Samoa
                [16] => Pacific/Niue
                [17] => Pacific/Niue
                [18] => Pacific/Enderbury
                [19] => Pacific/Apia
                [20] => Pacific/Pago_Pago
                [21] => Pacific/Samoa
                [22] => US/Samoa
                [23] => Pacific/Samoa
                [24] => Pacific/Midway
                [25] => Pacific/Pago_Pago
                [26] => US/Samoa
                [27] => Pacific/Apia
            )
    
        [-10] => Array
            (
                [0] => America/Anchorage
                [1] => America/Adak
                [2] => America/Atka
                [3] => US/Alaska
                [4] => US/Aleutian
                [5] => America/Adak
                [6] => America/Atka
                [7] => America/Nome
                [8] => US/Aleutian
                [9] => America/Anchorage
                [10] => US/Alaska
                [11] => Pacific/Rarotonga
                [12] => America/Adak
                [13] => America/Atka
                [14] => US/Aleutian
                [15] => Pacific/Honolulu
                [16] => Pacific/Honolulu
                [17] => HST
                [18] => US/Hawaii
                [19] => HST
                [20] => US/Hawaii
                [21] => Pacific/Kiritimati
                [22] => Pacific/Midway
                [23] => America/Adak
                [24] => America/Atka
                [25] => America/Nome
                [26] => US/Aleutian
                [27] => America/Adak
                [28] => America/Atka
                [29] => America/Nome
                [30] => US/Aleutian
                [31] => Pacific/Tahiti
            )
    
        [-9] => Array
            (
                [0] => America/Anchorage
                [1] => US/Alaska
                [2] => America/Anchorage
                [3] => America/Juneau
                [4] => America/Nome
                [5] => America/Yakutat
                [6] => US/Alaska
                [7] => America/Anchorage
                [8] => US/Alaska
                [9] => America/Anchorage
                [10] => US/Alaska
                [11] => Pacific/Rarotonga
                [12] => Pacific/Gambier
                [13] => America/Adak
                [14] => America/Atka
                [15] => US/Aleutian
                [16] => Pacific/Honolulu
                [17] => HST
                [18] => US/Hawaii
                [19] => Pacific/Honolulu
                [20] => HST
                [21] => US/Hawaii
                [22] => Pacific/Honolulu
                [23] => HST
                [24] => US/Hawaii
                [25] => Pacific/Marquesas
                [26] => America/Anchorage
                [27] => America/Dawson
                [28] => America/Juneau
                [29] => America/Nome
                [30] => America/Whitehorse
                [31] => America/Yakutat
                [32] => Canada/Yukon
                [33] => US/Alaska
            )
    
        [-8] => Array
            (
                [0] => America/Anchorage
                [1] => America/Juneau
                [2] => America/Nome
                [3] => America/Yakutat
                [4] => US/Alaska
                [5] => America/Los_Angeles
                [6] => America/Boise
                [7] => America/Dawson
                [8] => America/Dawson_Creek
                [9] => America/Ensenada
                [10] => America/Hermosillo
                [11] => America/Inuvik
                [12] => America/Juneau
                [13] => America/Mazatlan
                [14] => America/Tijuana
                [15] => America/Vancouver
                [16] => America/Whitehorse
                [17] => Canada/Pacific
                [18] => Canada/Yukon
                [19] => Mexico/BajaNorte
                [20] => Mexico/BajaSur
                [21] => Pacific/Pitcairn
                [22] => PST8PDT
                [23] => US/Pacific
                [24] => US/Pacific-New
                [25] => America/Dawson
                [26] => America/Whitehorse
                [27] => America/Yakutat
                [28] => Canada/Yukon
                [29] => America/Dawson
                [30] => America/Whitehorse
                [31] => America/Yakutat
                [32] => Canada/Yukon
                [33] => America/Dawson
                [34] => America/Whitehorse
                [35] => America/Yakutat
                [36] => Canada/Yukon
            )
    
        [-7] => Array
            (
                [0] => Chile/EasterIsland
                [1] => Pacific/Easter
                [2] => America/Denver
                [3] => America/Boise
                [4] => America/Cambridge_Bay
                [5] => America/Chihuahua
                [6] => America/Dawson_Creek
                [7] => America/Edmonton
                [8] => America/Ensenada
                [9] => America/Hermosillo
                [10] => America/Inuvik
                [11] => America/Mazatlan
                [12] => America/Mexico_City
                [13] => America/North_Dakota/Center
                [14] => America/North_Dakota/New_Salem
                [15] => America/Phoenix
                [16] => America/Regina
                [17] => America/Shiprock
                [18] => America/Swift_Current
                [19] => America/Tijuana
                [20] => America/Yellowknife
                [21] => Canada/East-Saskatchewan
                [22] => Canada/Mountain
                [23] => Canada/Saskatchewan
                [24] => Mexico/BajaNorte
                [25] => Mexico/BajaSur
                [26] => Mexico/General
                [27] => MST
                [28] => MST7MDT
                [29] => Navajo
                [30] => US/Arizona
                [31] => US/Mountain
                [32] => America/Los_Angeles
                [33] => America/Boise
                [34] => America/Dawson
                [35] => America/Dawson_Creek
                [36] => America/Ensenada
                [37] => America/Inuvik
                [38] => America/Juneau
                [39] => America/Tijuana
                [40] => America/Vancouver
                [41] => America/Whitehorse
                [42] => Canada/Pacific
                [43] => Canada/Yukon
                [44] => Mexico/BajaNorte
                [45] => PST8PDT
                [46] => US/Pacific
                [47] => US/Pacific-New
                [48] => America/Los_Angeles
                [49] => America/Dawson_Creek
                [50] => America/Ensenada
                [51] => America/Inuvik
                [52] => America/Juneau
                [53] => America/Tijuana
                [54] => America/Vancouver
                [55] => Canada/Pacific
                [56] => Mexico/BajaNorte
                [57] => PST8PDT
                [58] => US/Pacific
                [59] => US/Pacific-New
                [60] => America/Los_Angeles
                [61] => America/Dawson_Creek
                [62] => America/Ensenada
                [63] => America/Inuvik
                [64] => America/Juneau
                [65] => America/Tijuana
                [66] => America/Vancouver
                [67] => Canada/Pacific
                [68] => Mexico/BajaNorte
                [69] => PST8PDT
                [70] => US/Pacific
                [71] => US/Pacific-New
                [72] => America/Dawson
                [73] => America/Whitehorse
                [74] => Canada/Yukon
            )
    
        [-6] => Array
            (
                [0] => America/Chicago
                [1] => America/Atikokan
                [2] => America/Belize
                [3] => America/Cambridge_Bay
                [4] => America/Cancun
                [5] => America/Chihuahua
                [6] => America/Coral_Harbour
                [7] => America/Costa_Rica
                [8] => America/Detroit
                [9] => America/El_Salvador
                [10] => America/Fort_Wayne
                [11] => America/Guatemala
                [12] => America/Hermosillo
                [13] => America/Indiana/Indianapolis
                [14] => America/Indiana/Knox
                [15] => America/Indiana/Marengo
                [16] => America/Indiana/Petersburg
                [17] => America/Indiana/Vevay
                [18] => America/Indiana/Vincennes
                [19] => America/Indiana/Winamac
                [20] => America/Indianapolis
                [21] => America/Iqaluit
                [22] => America/Kentucky/Louisville
                [23] => America/Kentucky/Monticello
                [24] => America/Knox_IN
                [25] => America/Louisville
                [26] => America/Managua
                [27] => America/Mazatlan
                [28] => America/Menominee
                [29] => America/Merida
                [30] => America/Mexico_City
                [31] => America/Monterrey
                [32] => America/North_Dakota/Center
                [33] => America/North_Dakota/New_Salem
                [34] => America/Pangnirtung
                [35] => America/Rainy_River
                [36] => America/Rankin_Inlet
                [37] => America/Regina
                [38] => America/Swift_Current
                [39] => America/Tegucigalpa
                [40] => America/Winnipeg
                [41] => Canada/Central
                [42] => Canada/East-Saskatchewan
                [43] => Canada/Saskatchewan
                [44] => CST6CDT
                [45] => Mexico/BajaSur
                [46] => Mexico/General
                [47] => US/Central
                [48] => US/East-Indiana
                [49] => US/Indiana-Starke
                [50] => US/Michigan
                [51] => Chile/EasterIsland
                [52] => Pacific/Easter
                [53] => Chile/EasterIsland
                [54] => Pacific/Easter
                [55] => Pacific/Galapagos
                [56] => America/Denver
                [57] => America/Boise
                [58] => America/Cambridge_Bay
                [59] => America/Chihuahua
                [60] => America/Edmonton
                [61] => America/Hermosillo
                [62] => America/Inuvik
                [63] => America/Mazatlan
                [64] => America/North_Dakota/Center
                [65] => America/North_Dakota/New_Salem
                [66] => America/Phoenix
                [67] => America/Regina
                [68] => America/Shiprock
                [69] => America/Swift_Current
                [70] => America/Yellowknife
                [71] => Canada/East-Saskatchewan
                [72] => Canada/Mountain
                [73] => Canada/Saskatchewan
                [74] => Mexico/BajaSur
                [75] => MST
                [76] => MST7MDT
                [77] => Navajo
                [78] => US/Arizona
                [79] => US/Mountain
                [80] => America/Denver
                [81] => America/Boise
                [82] => America/Cambridge_Bay
                [83] => America/Edmonton
                [84] => America/North_Dakota/Center
                [85] => America/North_Dakota/New_Salem
                [86] => America/Regina
                [87] => America/Shiprock
                [88] => America/Swift_Current
                [89] => America/Yellowknife
                [90] => Canada/East-Saskatchewan
                [91] => Canada/Mountain
                [92] => Canada/Saskatchewan
                [93] => MST
                [94] => MST7MDT
                [95] => Navajo
                [96] => US/Mountain
                [97] => America/Denver
                [98] => America/Boise
                [99] => America/Cambridge_Bay
                [100] => America/Edmonton
                [101] => America/North_Dakota/Center
                [102] => America/North_Dakota/New_Salem
                [103] => America/Phoenix
                [104] => America/Regina
                [105] => America/Shiprock
                [106] => America/Swift_Current
                [107] => America/Yellowknife
                [108] => Canada/East-Saskatchewan
                [109] => Canada/Mountain
                [110] => Canada/Saskatchewan
                [111] => MST
                [112] => MST7MDT
                [113] => Navajo
                [114] => US/Arizona
                [115] => US/Mountain
                [116] => America/Inuvik
            )
    
        [-5] => Array
            (
                [0] => America/Porto_Acre
                [1] => America/Eirunepe
                [2] => America/Rio_Branco
                [3] => Brazil/Acre
                [4] => America/Chicago
                [5] => America/Atikokan
                [6] => America/Belize
                [7] => America/Cambridge_Bay
                [8] => America/Cancun
                [9] => America/Chihuahua
                [10] => America/Coral_Harbour
                [11] => America/Costa_Rica
                [12] => America/El_Salvador
                [13] => America/Fort_Wayne
                [14] => America/Guatemala
                [15] => America/Indiana/Indianapolis
                [16] => America/Indiana/Knox
                [17] => America/Indiana/Marengo
                [18] => America/Indiana/Petersburg
                [19] => America/Indiana/Vevay
                [20] => America/Indiana/Vincennes
                [21] => America/Indiana/Winamac
                [22] => America/Indianapolis
                [23] => America/Iqaluit
                [24] => America/Kentucky/Louisville
                [25] => America/Kentucky/Monticello
                [26] => America/Knox_IN
                [27] => America/Louisville
                [28] => America/Managua
                [29] => America/Menominee
                [30] => America/Merida
                [31] => America/Mexico_City
                [32] => America/Monterrey
                [33] => America/North_Dakota/Center
                [34] => America/North_Dakota/New_Salem
                [35] => America/Pangnirtung
                [36] => America/Rainy_River
                [37] => America/Rankin_Inlet
                [38] => America/Tegucigalpa
                [39] => America/Winnipeg
                [40] => Canada/Central
                [41] => CST6CDT
                [42] => Mexico/General
                [43] => US/Central
                [44] => US/East-Indiana
                [45] => US/Indiana-Starke
                [46] => America/Belize
                [47] => America/Santiago
                [48] => Chile/Continental
                [49] => America/Bogota
                [50] => America/Chicago
                [51] => America/Atikokan
                [52] => America/Coral_Harbour
                [53] => America/Fort_Wayne
                [54] => America/Indiana/Indianapolis
                [55] => America/Indiana/Knox
                [56] => America/Indiana/Marengo
                [57] => America/Indiana/Petersburg
                [58] => America/Indiana/Vevay
                [59] => America/Indiana/Vincennes
                [60] => America/Indiana/Winamac
                [61] => America/Indianapolis
                [62] => America/Kentucky/Louisville
                [63] => America/Kentucky/Monticello
                [64] => America/Knox_IN
                [65] => America/Louisville
                [66] => America/Menominee
                [67] => America/Rainy_River
                [68] => America/Rankin_Inlet
                [69] => America/Winnipeg
                [70] => Canada/Central
                [71] => CST6CDT
                [72] => US/Central
                [73] => US/East-Indiana
                [74] => US/Indiana-Starke
                [75] => America/Havana
                [76] => Cuba
                [77] => America/Chicago
                [78] => America/Atikokan
                [79] => America/Coral_Harbour
                [80] => America/Fort_Wayne
                [81] => America/Indiana/Indianapolis
                [82] => America/Indiana/Knox
                [83] => America/Indiana/Marengo
                [84] => America/Indiana/Petersburg
                [85] => America/Indiana/Vevay
                [86] => America/Indiana/Vincennes
                [87] => America/Indiana/Winamac
                [88] => America/Indianapolis
                [89] => America/Kentucky/Louisville
                [90] => America/Kentucky/Monticello
                [91] => America/Knox_IN
                [92] => America/Louisville
                [93] => America/Menominee
                [94] => America/Mexico_City
                [95] => America/Rainy_River
                [96] => America/Rankin_Inlet
                [97] => America/Winnipeg
                [98] => Canada/Central
                [99] => CST6CDT
                [100] => Mexico/General
                [101] => US/Central
                [102] => US/East-Indiana
                [103] => US/Indiana-Starke
                [104] => Chile/EasterIsland
                [105] => Pacific/Easter
                [106] => America/Guayaquil
                [107] => Pacific/Galapagos
                [108] => America/New_York
                [109] => America/Antigua
                [110] => America/Atikokan
                [111] => America/Cambridge_Bay
                [112] => America/Cancun
                [113] => America/Cayman
                [114] => America/Chicago
                [115] => America/Coral_Harbour
                [116] => America/Detroit
                [117] => America/Fort_Wayne
                [118] => America/Grand_Turk
                [119] => America/Indiana/Indianapolis
                [120] => America/Indiana/Knox
                [121] => America/Indiana/Marengo
                [122] => America/Indiana/Petersburg
                [123] => America/Indiana/Vevay
                [124] => America/Indiana/Vincennes
                [125] => America/Indiana/Winamac
                [126] => America/Indianapolis
                [127] => America/Iqaluit
                [128] => America/Jamaica
                [129] => America/Kentucky/Louisville
                [130] => America/Kentucky/Monticello
                [131] => America/Knox_IN
                [132] => America/Louisville
                [133] => America/Managua
                [134] => America/Menominee
                [135] => America/Merida
                [136] => America/Montreal
                [137] => America/Nassau
                [138] => America/Nipigon
                [139] => America/Panama
                [140] => America/Pangnirtung
                [141] => America/Port-au-Prince
                [142] => America/Rankin_Inlet
                [143] => America/Santo_Domingo
                [144] => America/Thunder_Bay
                [145] => America/Toronto
                [146] => Canada/Eastern
                [147] => EST
                [148] => EST5EDT
                [149] => Jamaica
                [150] => US/Central
                [151] => US/East-Indiana
                [152] => US/Eastern
                [153] => US/Indiana-Starke
                [154] => US/Michigan
                [155] => America/Cambridge_Bay
                [156] => America/Yellowknife
                [157] => America/Lima
            )
    
        [-4] => Array
            (
                [0] => America/Porto_Acre
                [1] => America/Eirunepe
                [2] => America/Rio_Branco
                [3] => Brazil/Acre
                [4] => America/Boa_Vista
                [5] => America/Campo_Grande
                [6] => America/Cuiaba
                [7] => America/Manaus
                [8] => America/Porto_Velho
                [9] => Brazil/West
                [10] => America/Curacao
                [11] => America/Aruba
                [12] => America/Buenos_Aires
                [13] => America/Argentina/Buenos_Aires
                [14] => America/Argentina/Catamarca
                [15] => America/Argentina/ComodRivadavia
                [16] => America/Argentina/Cordoba
                [17] => America/Argentina/Jujuy
                [18] => America/Argentina/La_Rioja
                [19] => America/Argentina/Mendoza
                [20] => America/Argentina/Rio_Gallegos
                [21] => America/Argentina/San_Juan
                [22] => America/Argentina/Tucuman
                [23] => America/Argentina/Ushuaia
                [24] => America/Catamarca
                [25] => America/Cordoba
                [26] => America/Jujuy
                [27] => America/Mendoza
                [28] => America/Rosario
                [29] => Antarctica/Palmer
                [30] => America/Anguilla
                [31] => America/Antigua
                [32] => America/Aruba
                [33] => America/Barbados
                [34] => America/Blanc-Sablon
                [35] => America/Curacao
                [36] => America/Dominica
                [37] => America/Glace_Bay
                [38] => America/Goose_Bay
                [39] => America/Grenada
                [40] => America/Guadeloupe
                [41] => America/Halifax
                [42] => America/Martinique
                [43] => America/Miquelon
                [44] => America/Moncton
                [45] => America/Montserrat
                [46] => America/Pangnirtung
                [47] => America/Port_of_Spain
                [48] => America/Puerto_Rico
                [49] => America/Santo_Domingo
                [50] => America/St_Kitts
                [51] => America/St_Lucia
                [52] => America/St_Thomas
                [53] => America/St_Vincent
                [54] => America/Thule
                [55] => America/Tortola
                [56] => America/Virgin
                [57] => Atlantic/Bermuda
                [58] => Canada/Atlantic
                [59] => America/La_Paz
                [60] => America/Rankin_Inlet
                [61] => America/Havana
                [62] => Cuba
                [63] => America/Santiago
                [64] => Chile/Continental
                [65] => America/Santiago
                [66] => Antarctica/Palmer
                [67] => Chile/Continental
                [68] => America/Bogota
                [69] => America/New_York
                [70] => America/Cancun
                [71] => America/Detroit
                [72] => America/Fort_Wayne
                [73] => America/Grand_Turk
                [74] => America/Indiana/Indianapolis
                [75] => America/Indiana/Marengo
                [76] => America/Indiana/Vevay
                [77] => America/Indiana/Vincennes
                [78] => America/Indiana/Winamac
                [79] => America/Indianapolis
                [80] => America/Iqaluit
                [81] => America/Jamaica
                [82] => America/Kentucky/Louisville
                [83] => America/Kentucky/Monticello
                [84] => America/Louisville
                [85] => America/Montreal
                [86] => America/Nassau
                [87] => America/Nipigon
                [88] => America/Pangnirtung
                [89] => America/Port-au-Prince
                [90] => America/Santo_Domingo
                [91] => America/Thunder_Bay
                [92] => America/Toronto
                [93] => Canada/Eastern
                [94] => EST
                [95] => EST5EDT
                [96] => Jamaica
                [97] => US/East-Indiana
                [98] => US/Eastern
                [99] => US/Michigan
                [100] => America/Santo_Domingo
                [101] => America/New_York
                [102] => America/Detroit
                [103] => America/Iqaluit
                [104] => America/Montreal
                [105] => America/Nipigon
                [106] => America/Thunder_Bay
                [107] => America/Toronto
                [108] => Canada/Eastern
                [109] => EST
                [110] => EST5EDT
                [111] => US/Eastern
                [112] => US/Michigan
                [113] => America/New_York
                [114] => America/Detroit
                [115] => America/Iqaluit
                [116] => America/Montreal
                [117] => America/Nipigon
                [118] => America/Thunder_Bay
                [119] => America/Toronto
                [120] => Canada/Eastern
                [121] => EST
                [122] => EST5EDT
                [123] => US/Eastern
                [124] => US/Michigan
                [125] => Atlantic/Stanley
                [126] => America/Cayenne
                [127] => America/Guyana
                [128] => America/Lima
                [129] => America/Asuncion
                [130] => America/Santiago
                [131] => Chile/Continental
                [132] => America/Caracas
                [133] => America/Caracas
                [134] => America/Mendoza
                [135] => America/Argentina/Catamarca
                [136] => America/Argentina/ComodRivadavia
                [137] => America/Argentina/Cordoba
                [138] => America/Argentina/Jujuy
                [139] => America/Argentina/La_Rioja
                [140] => America/Argentina/Mendoza
                [141] => America/Argentina/Rio_Gallegos
                [142] => America/Argentina/San_Juan
                [143] => America/Argentina/Tucuman
                [144] => America/Argentina/Ushuaia
                [145] => America/Catamarca
                [146] => America/Cordoba
                [147] => America/Jujuy
                [148] => America/Rosario
            )
    
        [-3] => Array
            (
                [0] => America/Halifax
                [1] => America/Barbados
                [2] => America/Blanc-Sablon
                [3] => America/Glace_Bay
                [4] => America/Goose_Bay
                [5] => America/Martinique
                [6] => America/Moncton
                [7] => America/Pangnirtung
                [8] => America/Thule
                [9] => Atlantic/Bermuda
                [10] => Canada/Atlantic
                [11] => America/Boa_Vista
                [12] => America/Campo_Grande
                [13] => America/Cuiaba
                [14] => America/Manaus
                [15] => America/Porto_Velho
                [16] => Brazil/West
                [17] => America/Halifax
                [18] => America/Blanc-Sablon
                [19] => America/Glace_Bay
                [20] => America/Moncton
                [21] => America/Pangnirtung
                [22] => America/Puerto_Rico
                [23] => Canada/Atlantic
                [24] => America/Buenos_Aires
                [25] => America/Argentina/Buenos_Aires
                [26] => America/Argentina/Catamarca
                [27] => America/Argentina/ComodRivadavia
                [28] => America/Argentina/Cordoba
                [29] => America/Argentina/Jujuy
                [30] => America/Argentina/La_Rioja
                [31] => America/Argentina/Mendoza
                [32] => America/Argentina/Rio_Gallegos
                [33] => America/Argentina/San_Juan
                [34] => America/Argentina/Tucuman
                [35] => America/Argentina/Ushuaia
                [36] => America/Catamarca
                [37] => America/Cordoba
                [38] => America/Jujuy
                [39] => America/Mendoza
                [40] => America/Rosario
                [41] => Antarctica/Palmer
                [42] => America/Buenos_Aires
                [43] => America/Argentina/Buenos_Aires
                [44] => America/Argentina/Catamarca
                [45] => America/Argentina/ComodRivadavia
                [46] => America/Argentina/Cordoba
                [47] => America/Argentina/Jujuy
                [48] => America/Argentina/La_Rioja
                [49] => America/Argentina/Mendoza
                [50] => America/Argentina/Rio_Gallegos
                [51] => America/Argentina/San_Juan
                [52] => America/Argentina/Tucuman
                [53] => America/Argentina/Ushuaia
                [54] => America/Catamarca
                [55] => America/Cordoba
                [56] => America/Jujuy
                [57] => America/Mendoza
                [58] => America/Rosario
                [59] => Antarctica/Palmer
                [60] => America/Halifax
                [61] => America/Blanc-Sablon
                [62] => America/Glace_Bay
                [63] => America/Moncton
                [64] => America/Pangnirtung
                [65] => America/Puerto_Rico
                [66] => Canada/Atlantic
                [67] => America/Barbados
                [68] => America/La_Paz
                [69] => America/Sao_Paulo
                [70] => America/Araguaina
                [71] => America/Bahia
                [72] => America/Belem
                [73] => America/Fortaleza
                [74] => America/Maceio
                [75] => America/Recife
                [76] => Brazil/East
                [77] => America/Santiago
                [78] => Antarctica/Palmer
                [79] => Chile/Continental
                [80] => America/Iqaluit
                [81] => Atlantic/Stanley
                [82] => Atlantic/Stanley
                [83] => America/Guyana
                [84] => America/Cayenne
                [85] => America/Guyana
                [86] => America/Guyana
                [87] => America/Paramaribo
                [88] => America/St_Johns
                [89] => America/St_Johns
                [90] => America/Goose_Bay
                [91] => Canada/Newfoundland
                [92] => America/Goose_Bay
                [93] => Canada/Newfoundland
                [94] => America/Miquelon
                [95] => America/Paramaribo
                [96] => America/Paramaribo
                [97] => America/Asuncion
                [98] => America/Asuncion
                [99] => Antarctica/Rothera
                [100] => America/Paramaribo
                [101] => America/Paramaribo
                [102] => America/Montevideo
                [103] => America/Montevideo
                [104] => America/Montevideo
                [105] => America/Mendoza
                [106] => America/Argentina/Jujuy
                [107] => America/Argentina/Mendoza
                [108] => America/Jujuy
                [109] => America/Godthab
                [110] => America/Danmarkshavn
            )
    
        [-2] => Array
            (
                [0] => America/Goose_Bay
                [1] => America/Pangnirtung
                [2] => America/Buenos_Aires
                [3] => America/Argentina/Buenos_Aires
                [4] => America/Argentina/Catamarca
                [5] => America/Argentina/ComodRivadavia
                [6] => America/Argentina/Cordoba
                [7] => America/Argentina/Jujuy
                [8] => America/Argentina/La_Rioja
                [9] => America/Argentina/Mendoza
                [10] => America/Argentina/Rio_Gallegos
                [11] => America/Argentina/San_Juan
                [12] => America/Argentina/Tucuman
                [13] => America/Argentina/Ushuaia
                [14] => America/Catamarca
                [15] => America/Cordoba
                [16] => America/Jujuy
                [17] => America/Mendoza
                [18] => America/Rosario
                [19] => Antarctica/Palmer
                [20] => Atlantic/Azores
                [21] => America/Sao_Paulo
                [22] => America/Araguaina
                [23] => America/Bahia
                [24] => America/Belem
                [25] => America/Fortaleza
                [26] => America/Maceio
                [27] => America/Recife
                [28] => Brazil/East
                [29] => America/Scoresbysund
                [30] => Atlantic/Cape_Verde
                [31] => Atlantic/Stanley
                [32] => America/Noronha
                [33] => Brazil/DeNoronha
                [34] => America/St_Johns
                [35] => America/St_Johns
                [36] => America/Goose_Bay
                [37] => Canada/Newfoundland
                [38] => America/Goose_Bay
                [39] => Canada/Newfoundland
                [40] => America/St_Johns
                [41] => America/Goose_Bay
                [42] => Canada/Newfoundland
                [43] => America/St_Johns
                [44] => America/Goose_Bay
                [45] => Canada/Newfoundland
                [46] => America/Miquelon
                [47] => America/Montevideo
                [48] => America/Montevideo
                [49] => America/Godthab
                [50] => America/Danmarkshavn
            )
    
        [-1] => Array
            (
                [0] => Atlantic/Azores
                [1] => Atlantic/Azores
                [2] => Africa/Banjul
                [3] => Atlantic/Canary
                [4] => America/Scoresbysund
                [5] => Atlantic/Cape_Verde
                [6] => Atlantic/Cape_Verde
                [7] => America/Scoresbysund
                [8] => America/Noronha
                [9] => Brazil/DeNoronha
                [10] => Atlantic/Reykjavik
                [11] => Iceland
                [12] => Atlantic/Madeira
                [13] => America/St_Johns
                [14] => Canada/Newfoundland
                [15] => Africa/Dakar
                [16] => Africa/Bamako
                [17] => Africa/Banjul
                [18] => Africa/Bissau
                [19] => Africa/Conakry
                [20] => Africa/El_Aaiun
                [21] => Africa/Freetown
                [22] => Africa/Niamey
                [23] => Africa/Nouakchott
                [24] => Africa/Timbuktu
            )
    
        [0] => Array
            (
                [0] => Europe/Amsterdam
                [1] => Atlantic/Azores
                [2] => Atlantic/Azores
                [3] => America/Scoresbysund
                [4] => Africa/Accra
                [5] => Africa/Abidjan
                [6] => Africa/Accra
                [7] => Africa/Bamako
                [8] => Africa/Banjul
                [9] => Africa/Bissau
                [10] => Africa/Conakry
                [11] => Africa/Dakar
                [12] => Africa/Freetown
                [13] => Africa/Malabo
                [14] => Africa/Monrovia
                [15] => Africa/Niamey
                [16] => Africa/Nouakchott
                [17] => Africa/Ouagadougou
                [18] => Africa/Porto-Novo
                [19] => Africa/Sao_Tome
                [20] => Africa/Timbuktu
                [21] => America/Danmarkshavn
                [22] => Atlantic/Reykjavik
                [23] => Atlantic/St_Helena
                [24] => Eire
                [25] => Europe/Belfast
                [26] => Europe/Dublin
                [27] => Europe/Gibraltar
                [28] => Europe/Guernsey
                [29] => Europe/Isle_of_Man
                [30] => Europe/Jersey
                [31] => Europe/London
                [32] => GB
                [33] => GB-Eire
                [34] => Iceland
                [35] => Atlantic/Reykjavik
                [36] => Iceland
                [37] => Eire
                [38] => Europe/Dublin
                [39] => Africa/Monrovia
                [40] => Atlantic/Madeira
                [41] => Europe/Amsterdam
                [42] => Africa/Freetown
                [43] => Africa/Freetown
                [44] => Europe/Paris
                [45] => Africa/Algiers
                [46] => Africa/Casablanca
                [47] => Africa/Ceuta
                [48] => Africa/El_Aaiun
                [49] => Atlantic/Azores
                [50] => Atlantic/Canary
                [51] => Atlantic/Faeroe
                [52] => Atlantic/Faroe
                [53] => Atlantic/Madeira
                [54] => Europe/Brussels
                [55] => Europe/Lisbon
                [56] => Europe/Luxembourg
                [57] => Europe/Madrid
                [58] => Europe/Monaco
                [59] => Portugal
                [60] => WET
                [61] => UTC
                [62] => Antarctica/Davis
                [63] => Antarctica/DumontDUrville
            )
    
        [1] => Array
            (
                [0] => Europe/Tiraspol
                [1] => Europe/Chisinau
                [2] => Europe/London
                [3] => Europe/London
                [4] => Europe/Belfast
                [5] => Europe/Guernsey
                [6] => Europe/Isle_of_Man
                [7] => Europe/Jersey
                [8] => GB
                [9] => GB-Eire
                [10] => Eire
                [11] => Europe/Belfast
                [12] => Europe/Dublin
                [13] => Europe/Gibraltar
                [14] => Europe/Guernsey
                [15] => Europe/Isle_of_Man
                [16] => Europe/Jersey
                [17] => GB
                [18] => GB-Eire
                [19] => Europe/Berlin
                [20] => Africa/Algiers
                [21] => Africa/Casablanca
                [22] => Africa/Ceuta
                [23] => Africa/Tripoli
                [24] => Africa/Tunis
                [25] => Arctic/Longyearbyen
                [26] => Atlantic/Jan_Mayen
                [27] => CET
                [28] => Europe/Amsterdam
                [29] => Europe/Andorra
                [30] => Europe/Athens
                [31] => Europe/Belgrade
                [32] => Europe/Bratislava
                [33] => Europe/Brussels
                [34] => Europe/Budapest
                [35] => Europe/Chisinau
                [36] => Europe/Copenhagen
                [37] => Europe/Gibraltar
                [38] => Europe/Kaliningrad
                [39] => Europe/Kiev
                [40] => Europe/Lisbon
                [41] => Europe/Ljubljana
                [42] => Europe/Luxembourg
                [43] => Europe/Madrid
                [44] => Europe/Malta
                [45] => Europe/Minsk
                [46] => Europe/Monaco
                [47] => Europe/Oslo
                [48] => Europe/Paris
                [49] => Europe/Podgorica
                [50] => Europe/Prague
                [51] => Europe/Riga
                [52] => Europe/Rome
                [53] => Europe/San_Marino
                [54] => Europe/Sarajevo
                [55] => Europe/Simferopol
                [56] => Europe/Skopje
                [57] => Europe/Sofia
                [58] => Europe/Stockholm
                [59] => Europe/Tallinn
                [60] => Europe/Tirane
                [61] => Europe/Tiraspol
                [62] => Europe/Uzhgorod
                [63] => Europe/Vaduz
                [64] => Europe/Vatican
                [65] => Europe/Vienna
                [66] => Europe/Vilnius
                [67] => Europe/Warsaw
                [68] => Europe/Zagreb
                [69] => Europe/Zaporozhye
                [70] => Europe/Zurich
                [71] => Libya
                [72] => Poland
                [73] => Portugal
                [74] => WET
                [75] => Eire
                [76] => Europe/Dublin
                [77] => Eire
                [78] => Europe/Dublin
                [79] => Europe/Vilnius
                [80] => Atlantic/Madeira
                [81] => MET
                [82] => Europe/Amsterdam
                [83] => Europe/Amsterdam
                [84] => Europe/Riga
                [85] => Africa/Freetown
                [86] => Europe/Tallinn
                [87] => Africa/Brazzaville
                [88] => Africa/Bangui
                [89] => Africa/Douala
                [90] => Africa/Lagos
                [91] => Africa/Libreville
                [92] => Africa/Luanda
                [93] => Africa/Malabo
                [94] => Africa/Ndjamena
                [95] => Africa/Niamey
                [96] => Africa/Porto-Novo
                [97] => Africa/Windhoek
                [98] => Europe/Paris
                [99] => Africa/Algiers
                [100] => Africa/Casablanca
                [101] => Africa/Ceuta
                [102] => Atlantic/Canary
                [103] => Atlantic/Faeroe
                [104] => Atlantic/Faroe
                [105] => Atlantic/Madeira
                [106] => Europe/Brussels
                [107] => Europe/Lisbon
                [108] => Europe/Luxembourg
                [109] => Europe/Madrid
                [110] => Europe/Monaco
                [111] => Portugal
                [112] => WET
                [113] => Europe/Luxembourg
            )
    
        [2] => Array
            (
                [0] => Europe/London
                [1] => Europe/Belfast
                [2] => Europe/Gibraltar
                [3] => Europe/Guernsey
                [4] => Europe/Isle_of_Man
                [5] => Europe/Jersey
                [6] => GB
                [7] => GB-Eire
                [8] => Africa/Mogadishu
                [9] => Africa/Kampala
                [10] => Africa/Nairobi
                [11] => Africa/Nairobi
                [12] => Africa/Dar_es_Salaam
                [13] => Africa/Kampala
                [14] => Africa/Khartoum
                [15] => Africa/Blantyre
                [16] => Africa/Gaborone
                [17] => Africa/Harare
                [18] => Africa/Kigali
                [19] => Africa/Lusaka
                [20] => Africa/Maputo
                [21] => Africa/Windhoek
                [22] => Europe/Berlin
                [23] => Africa/Algiers
                [24] => Africa/Ceuta
                [25] => Africa/Tripoli
                [26] => Africa/Tunis
                [27] => Arctic/Longyearbyen
                [28] => Atlantic/Jan_Mayen
                [29] => CET
                [30] => Europe/Amsterdam
                [31] => Europe/Andorra
                [32] => Europe/Athens
                [33] => Europe/Belgrade
                [34] => Europe/Bratislava
                [35] => Europe/Brussels
                [36] => Europe/Budapest
                [37] => Europe/Chisinau
                [38] => Europe/Copenhagen
                [39] => Europe/Gibraltar
                [40] => Europe/Kaliningrad
                [41] => Europe/Kiev
                [42] => Europe/Lisbon
                [43] => Europe/Ljubljana
                [44] => Europe/Luxembourg
                [45] => Europe/Madrid
                [46] => Europe/Malta
                [47] => Europe/Minsk
                [48] => Europe/Monaco
                [49] => Europe/Oslo
                [50] => Europe/Paris
                [51] => Europe/Podgorica
                [52] => Europe/Prague
                [53] => Europe/Riga
                [54] => Europe/Rome
                [55] => Europe/San_Marino
                [56] => Europe/Sarajevo
                [57] => Europe/Simferopol
                [58] => Europe/Skopje
                [59] => Europe/Sofia
                [60] => Europe/Stockholm
                [61] => Europe/Tallinn
                [62] => Europe/Tirane
                [63] => Europe/Tiraspol
                [64] => Europe/Uzhgorod
                [65] => Europe/Vaduz
                [66] => Europe/Vatican
                [67] => Europe/Vienna
                [68] => Europe/Vilnius
                [69] => Europe/Warsaw
                [70] => Europe/Zagreb
                [71] => Europe/Zaporozhye
                [72] => Europe/Zurich
                [73] => Libya
                [74] => Poland
                [75] => Portugal
                [76] => WET
                [77] => Europe/Kaliningrad
                [78] => Europe/Helsinki
                [79] => Africa/Cairo
                [80] => Africa/Tripoli
                [81] => Asia/Amman
                [82] => Asia/Beirut
                [83] => Asia/Damascus
                [84] => Asia/Gaza
                [85] => Asia/Istanbul
                [86] => Asia/Nicosia
                [87] => EET
                [88] => Egypt
                [89] => Europe/Athens
                [90] => Europe/Bucharest
                [91] => Europe/Chisinau
                [92] => Europe/Istanbul
                [93] => Europe/Kaliningrad
                [94] => Europe/Kiev
                [95] => Europe/Mariehamn
                [96] => Europe/Minsk
                [97] => Europe/Moscow
                [98] => Europe/Nicosia
                [99] => Europe/Riga
                [100] => Europe/Simferopol
                [101] => Europe/Sofia
                [102] => Europe/Tallinn
                [103] => Europe/Tiraspol
                [104] => Europe/Uzhgorod
                [105] => Europe/Vilnius
                [106] => Europe/Warsaw
                [107] => Europe/Zaporozhye
                [108] => Libya
                [109] => Poland
                [110] => Turkey
                [111] => W-SU
                [112] => Asia/Jerusalem
                [113] => Asia/Gaza
                [114] => Asia/Tel_Aviv
                [115] => Israel
                [116] => Europe/Riga
                [117] => MET
                [118] => Europe/Moscow
                [119] => W-SU
                [120] => Africa/Johannesburg
                [121] => Africa/Maseru
                [122] => Africa/Mbabane
                [123] => Africa/Windhoek
                [124] => Africa/Windhoek
                [125] => Africa/Ndjamena
                [126] => Europe/Lisbon
                [127] => Europe/Madrid
                [128] => Europe/Monaco
                [129] => Europe/Paris
                [130] => Portugal
                [131] => WET
                [132] => Europe/Luxembourg
            )
    
        [3] => Array
            (
                [0] => Asia/Yerevan
                [1] => Asia/Riyadh
                [2] => Asia/Aden
                [3] => Asia/Baghdad
                [4] => Asia/Bahrain
                [5] => Asia/Kuwait
                [6] => Asia/Qatar
                [7] => Asia/Baku
                [8] => Asia/Baku
                [9] => Africa/Gaborone
                [10] => Africa/Khartoum
                [11] => Europe/Berlin
                [12] => CET
                [13] => Europe/Kaliningrad
                [14] => Africa/Khartoum
                [15] => Africa/Addis_Ababa
                [16] => Africa/Asmara
                [17] => Africa/Asmera
                [18] => Africa/Dar_es_Salaam
                [19] => Africa/Djibouti
                [20] => Africa/Kampala
                [21] => Africa/Mogadishu
                [22] => Africa/Nairobi
                [23] => Indian/Antananarivo
                [24] => Indian/Comoro
                [25] => Indian/Mayotte
                [26] => Europe/Helsinki
                [27] => Africa/Cairo
                [28] => Asia/Amman
                [29] => Asia/Beirut
                [30] => Asia/Damascus
                [31] => Asia/Gaza
                [32] => Asia/Istanbul
                [33] => Asia/Nicosia
                [34] => EET
                [35] => Egypt
                [36] => Europe/Athens
                [37] => Europe/Bucharest
                [38] => Europe/Chisinau
                [39] => Europe/Istanbul
                [40] => Europe/Kaliningrad
                [41] => Europe/Kiev
                [42] => Europe/Mariehamn
                [43] => Europe/Minsk
                [44] => Europe/Moscow
                [45] => Europe/Nicosia
                [46] => Europe/Riga
                [47] => Europe/Simferopol
                [48] => Europe/Sofia
                [49] => Europe/Tallinn
                [50] => Europe/Tiraspol
                [51] => Europe/Uzhgorod
                [52] => Europe/Vilnius
                [53] => Europe/Warsaw
                [54] => Europe/Zaporozhye
                [55] => Poland
                [56] => Turkey
                [57] => W-SU
                [58] => Asia/Gaza
                [59] => Asia/Tbilisi
                [60] => Asia/Jerusalem
                [61] => Asia/Gaza
                [62] => Asia/Tel_Aviv
                [63] => Israel
                [64] => Asia/Tehran
                [65] => Iran
                [66] => Europe/Samara
                [67] => Europe/Samara
                [68] => Europe/Moscow
                [69] => Europe/Chisinau
                [70] => Europe/Kaliningrad
                [71] => Europe/Kiev
                [72] => Europe/Minsk
                [73] => Europe/Riga
                [74] => Europe/Simferopol
                [75] => Europe/Tallinn
                [76] => Europe/Tiraspol
                [77] => Europe/Uzhgorod
                [78] => Europe/Vilnius
                [79] => Europe/Zaporozhye
                [80] => W-SU
                [81] => Europe/Moscow
                [82] => W-SU
                [83] => Europe/Samara
                [84] => Africa/Johannesburg
                [85] => Africa/Maseru
                [86] => Africa/Windhoek
                [87] => Europe/Volgograd
                [88] => Antarctica/Syowa
                [89] => Asia/Tbilisi
                [90] => Asia/Tehran
                [91] => Iran
                [92] => Europe/Istanbul
                [93] => Asia/Istanbul
                [94] => Turkey
                [95] => Europe/Volgograd
                [96] => Europe/Volgograd
                [97] => Asia/Yerevan
            )
    
        [4] => Array
            (
                [0] => Asia/Baghdad
                [1] => Asia/Kabul
                [2] => Asia/Aqtobe
                [3] => Asia/Yerevan
                [4] => Asia/Yerevan
                [5] => Asia/Aqtau
                [6] => Asia/Ashkhabad
                [7] => Asia/Ashgabat
                [8] => Asia/Baku
                [9] => Asia/Baku
                [10] => Asia/Baku
                [11] => Asia/Baku
                [12] => Indian/Antananarivo
                [13] => Asia/Aqtau
                [14] => Asia/Tbilisi
                [15] => Asia/Tbilisi
                [16] => Asia/Dubai
                [17] => Asia/Bahrain
                [18] => Asia/Muscat
                [19] => Asia/Qatar
                [20] => Asia/Jerusalem
                [21] => Asia/Tel_Aviv
                [22] => Israel
                [23] => Asia/Tehran
                [24] => Iran
                [25] => Asia/Tehran
                [26] => Iran
                [27] => Asia/Qyzylorda
                [28] => Europe/Samara
                [29] => Europe/Samara
                [30] => Europe/Moscow
                [31] => W-SU
                [32] => Europe/Moscow
                [33] => Europe/Chisinau
                [34] => Europe/Kaliningrad
                [35] => Europe/Kiev
                [36] => Europe/Minsk
                [37] => Europe/Riga
                [38] => Europe/Simferopol
                [39] => Europe/Tallinn
                [40] => Europe/Tiraspol
                [41] => Europe/Uzhgorod
                [42] => Europe/Vilnius
                [43] => Europe/Zaporozhye
                [44] => W-SU
                [45] => Indian/Mauritius
                [46] => Asia/Oral
                [47] => Indian/Reunion
                [48] => Asia/Samarkand
                [49] => Europe/Samara
                [50] => Indian/Mahe
                [51] => Europe/Volgograd
                [52] => Asia/Yekaterinburg
                [53] => Asia/Tbilisi
                [54] => Asia/Tbilisi
                [55] => Asia/Ashgabat
                [56] => Asia/Ashkhabad
                [57] => Europe/Istanbul
                [58] => Asia/Istanbul
                [59] => Turkey
                [60] => Asia/Oral
                [61] => Europe/Volgograd
                [62] => Europe/Volgograd
                [63] => Asia/Yerevan
                [64] => Asia/Yerevan
            )
    
        [5] => Array
            (
                [0] => Asia/Aqtobe
                [1] => Asia/Almaty
                [2] => Asia/Yerevan
                [3] => Asia/Aqtau
                [4] => Asia/Aqtau
                [5] => Asia/Aqtobe
                [6] => Asia/Ashkhabad
                [7] => Asia/Ashgabat
                [8] => Asia/Ashkhabad
                [9] => Asia/Ashgabat
                [10] => Asia/Baku
                [11] => Asia/Baku
                [12] => Asia/Dushanbe
                [13] => Asia/Aqtau
                [14] => Asia/Bishkek
                [15] => Asia/Tbilisi
                [16] => Indian/Chagos
                [17] => Asia/Tehran
                [18] => Iran
                [19] => Asia/Calcutta
                [20] => Asia/Colombo
                [21] => Asia/Dacca
                [22] => Asia/Dhaka
                [23] => Asia/Karachi
                [24] => Asia/Katmandu
                [25] => Asia/Thimbu
                [26] => Asia/Thimphu
                [27] => Asia/Karachi
                [28] => Asia/Kashgar
                [29] => Asia/Kashgar
                [30] => Asia/Bishkek
                [31] => Asia/Qyzylorda
                [32] => Europe/Samara
                [33] => Europe/Moscow
                [34] => W-SU
                [35] => Indian/Maldives
                [36] => Asia/Katmandu
                [37] => Asia/Omsk
                [38] => Asia/Oral
                [39] => Asia/Oral
                [40] => Asia/Karachi
                [41] => Asia/Qyzylorda
                [42] => Europe/Samara
                [43] => Asia/Samarkand
                [44] => Asia/Aqtau
                [45] => Asia/Yekaterinburg
                [46] => Asia/Yekaterinburg
                [47] => Asia/Tashkent
                [48] => Asia/Tbilisi
                [49] => Indian/Kerguelen
                [50] => Asia/Dushanbe
                [51] => Asia/Ashgabat
                [52] => Asia/Ashkhabad
                [53] => Asia/Oral
                [54] => Asia/Oral
                [55] => Asia/Samarkand
                [56] => Asia/Tashkent
                [57] => Europe/Volgograd
                [58] => Asia/Yekaterinburg
                [59] => Asia/Yerevan
            )
    
        [6] => Array
            (
                [0] => Asia/Aqtobe
                [1] => Asia/Aqtobe
                [2] => Asia/Almaty
                [3] => Asia/Aqtau
                [4] => Asia/Aqtobe
                [5] => Asia/Ashkhabad
                [6] => Asia/Ashgabat
                [7] => Asia/Dacca
                [8] => Asia/Dhaka
                [9] => Asia/Thimbu
                [10] => Asia/Thimphu
                [11] => Asia/Calcutta
                [12] => Asia/Dacca
                [13] => Asia/Dhaka
                [14] => Asia/Rangoon
                [15] => Asia/Dacca
                [16] => Asia/Dhaka
                [17] => Asia/Dushanbe
                [18] => Asia/Dushanbe
                [19] => Asia/Bishkek
                [20] => Asia/Bishkek
                [21] => Asia/Hovd
                [22] => Asia/Colombo
                [23] => Indian/Chagos
                [24] => Asia/Calcutta
                [25] => Asia/Colombo
                [26] => Asia/Karachi
                [27] => Asia/Bishkek
                [28] => Asia/Bishkek
                [29] => Asia/Qyzylorda
                [30] => Asia/Qyzylorda
                [31] => Asia/Krasnoyarsk
                [32] => Asia/Colombo
                [33] => Asia/Colombo
                [34] => Antarctica/Mawson
                [35] => Asia/Rangoon
                [36] => Asia/Novosibirsk
                [37] => Asia/Omsk
                [38] => Asia/Omsk
                [39] => Asia/Karachi
                [40] => Asia/Qyzylorda
                [41] => Asia/Samarkand
                [42] => Asia/Aqtau
                [43] => Asia/Aqtau
                [44] => Asia/Yekaterinburg
                [45] => Asia/Tashkent
                [46] => Asia/Samarkand
                [47] => Asia/Tashkent
                [48] => Asia/Oral
                [49] => Asia/Oral
                [50] => Asia/Urumqi
                [51] => Asia/Samarkand
                [52] => Asia/Tashkent
                [53] => Antarctica/Vostok
                [54] => Asia/Yekaterinburg
            )
    
        [7] => Array
            (
                [0] => Asia/Almaty
                [1] => Asia/Brunei
                [2] => Asia/Kuching
                [3] => Antarctica/Davis
                [4] => Asia/Dushanbe
                [5] => Asia/Bishkek
                [6] => Asia/Hovd
                [7] => Asia/Bangkok
                [8] => Asia/Phnom_Penh
                [9] => Asia/Saigon
                [10] => Asia/Vientiane
                [11] => Asia/Irkutsk
                [12] => Asia/Jakarta
                [13] => Asia/Krasnoyarsk
                [14] => Asia/Krasnoyarsk
                [15] => Asia/Chongqing
                [16] => Asia/Chungking
                [17] => Asia/Singapore
                [18] => Asia/Kuala_Lumpur
                [19] => Singapore
                [20] => Asia/Singapore
                [21] => Asia/Singapore
                [22] => Asia/Singapore
                [23] => Asia/Kuala_Lumpur
                [24] => Singapore
                [25] => Asia/Kuala_Lumpur
                [26] => Singapore
                [27] => Asia/Kuala_Lumpur
                [28] => Singapore
                [29] => Asia/Makassar
                [30] => Asia/Ujung_Pandang
                [31] => Asia/Novosibirsk
                [32] => Asia/Novosibirsk
                [33] => Asia/Omsk
                [34] => Asia/Pontianak
                [35] => Asia/Qyzylorda
                [36] => Asia/Singapore
                [37] => Singapore
                [38] => Asia/Saigon
                [39] => Asia/Phnom_Penh
                [40] => Asia/Vientiane
                [41] => Asia/Samarkand
                [42] => Asia/Tashkent
                [43] => Asia/Ulaanbaatar
                [44] => Asia/Choibalsan
                [45] => Asia/Ulan_Bator
                [46] => Asia/Jakarta
                [47] => Asia/Jakarta
                [48] => Asia/Pontianak
                [49] => Asia/Pontianak
            )
    
        [8] => Array
            (
                [0] => Asia/Brunei
                [1] => Asia/Kuching
                [2] => Asia/Kuching
                [3] => Asia/Harbin
                [4] => Asia/Dili
                [5] => Asia/Makassar
                [6] => Asia/Pontianak
                [7] => Asia/Ujung_Pandang
                [8] => Asia/Chongqing
                [9] => Asia/Chungking
                [10] => Asia/Harbin
                [11] => Asia/Kashgar
                [12] => Asia/Macao
                [13] => Asia/Macau
                [14] => Asia/Shanghai
                [15] => Asia/Taipei
                [16] => Asia/Urumqi
                [17] => PRC
                [18] => ROC
                [19] => Australia/Eucla
                [20] => Asia/Hong_Kong
                [21] => Hongkong
                [22] => Asia/Hovd
                [23] => Asia/Phnom_Penh
                [24] => Asia/Saigon
                [25] => Asia/Vientiane
                [26] => Asia/Irkutsk
                [27] => Asia/Irkutsk
                [28] => Asia/Krasnoyarsk
                [29] => Asia/Seoul
                [30] => Asia/Seoul
                [31] => Asia/Pyongyang
                [32] => ROK
                [33] => Asia/Pyongyang
                [34] => ROK
                [35] => Asia/Macao
                [36] => Asia/Macau
                [37] => Asia/Kuala_Lumpur
                [38] => Asia/Kuching
                [39] => Asia/Novosibirsk
                [40] => Asia/Manila
                [41] => Asia/Singapore
                [42] => Singapore
                [43] => Asia/Dili
                [44] => Asia/Ulaanbaatar
                [45] => Asia/Choibalsan
                [46] => Asia/Ulan_Bator
                [47] => Asia/Jakarta
                [48] => Asia/Pontianak
                [49] => Australia/Perth
                [50] => Antarctica/Casey
                [51] => Australia/West
                [52] => Asia/Yakutsk
            )
    
        [9] => Array
            (
                [0] => Australia/Adelaide
                [1] => Asia/Shanghai
                [2] => Asia/Chongqing
                [3] => Asia/Chungking
                [4] => Asia/Harbin
                [5] => Asia/Kashgar
                [6] => Asia/Taipei
                [7] => Asia/Urumqi
                [8] => PRC
                [9] => ROC
                [10] => Asia/Harbin
                [11] => Asia/Choibalsan
                [12] => Asia/Sakhalin
                [13] => Asia/Jayapura
                [14] => Australia/Adelaide
                [15] => Australia/Broken_Hill
                [16] => Australia/Darwin
                [17] => Australia/North
                [18] => Australia/South
                [19] => Australia/Yancowinna
                [20] => Australia/Eucla
                [21] => Asia/Jayapura
                [22] => Asia/Hong_Kong
                [23] => Hongkong
                [24] => Asia/Irkutsk
                [25] => Asia/Tokyo
                [26] => Asia/Dili
                [27] => Asia/Jakarta
                [28] => Asia/Kuala_Lumpur
                [29] => Asia/Kuching
                [30] => Asia/Makassar
                [31] => Asia/Manila
                [32] => Asia/Pontianak
                [33] => Asia/Rangoon
                [34] => Asia/Sakhalin
                [35] => Asia/Singapore
                [36] => Asia/Ujung_Pandang
                [37] => Japan
                [38] => Pacific/Nauru
                [39] => Singapore
                [40] => Asia/Seoul
                [41] => ROK
                [42] => Asia/Seoul
                [43] => Asia/Pyongyang
                [44] => ROK
                [45] => Asia/Macao
                [46] => Asia/Macau
                [47] => Asia/Manila
                [48] => Asia/Dili
                [49] => Asia/Ulaanbaatar
                [50] => Asia/Ulan_Bator
                [51] => Asia/Vladivostok
                [52] => Asia/Vladivostok
                [53] => Australia/Perth
                [54] => Australia/West
                [55] => Asia/Yakutsk
                [56] => Asia/Yakutsk
            )
    
        [10] => Array
            (
                [0] => Asia/Choibalsan
                [1] => Australia/Adelaide
                [2] => Australia/Broken_Hill
                [3] => Australia/Darwin
                [4] => Australia/North
                [5] => Australia/South
                [6] => Australia/Yancowinna
                [7] => Pacific/Guam
                [8] => Pacific/Saipan
                [9] => Antarctica/DumontDUrville
                [10] => Australia/ACT
                [11] => Australia/Brisbane
                [12] => Australia/Canberra
                [13] => Australia/Currie
                [14] => Australia/Hobart
                [15] => Australia/Lindeman
                [16] => Australia/Melbourne
                [17] => Australia/NSW
                [18] => Australia/Queensland
                [19] => Australia/Sydney
                [20] => Australia/Tasmania
                [21] => Australia/Victoria
                [22] => Asia/Tokyo
                [23] => Japan
                [24] => Asia/Seoul
                [25] => ROK
                [26] => Australia/Lord_Howe
                [27] => Australia/LHI
                [28] => Asia/Magadan
                [29] => Pacific/Saipan
                [30] => Antarctica/DumontDUrville
                [31] => Asia/Sakhalin
                [32] => Asia/Vladivostok
                [33] => Asia/Vladivostok
                [34] => Asia/Yakutsk
            )
    
        [11] => Array
            (
                [0] => Asia/Anadyr
                [1] => Australia/Melbourne
                [2] => Australia/ACT
                [3] => Australia/Brisbane
                [4] => Australia/Canberra
                [5] => Australia/Currie
                [6] => Australia/Hobart
                [7] => Australia/Lindeman
                [8] => Australia/NSW
                [9] => Australia/Queensland
                [10] => Australia/Sydney
                [11] => Australia/Tasmania
                [12] => Australia/Victoria
                [13] => Pacific/Kosrae
                [14] => Australia/Lord_Howe
                [15] => Australia/Lord_Howe
                [16] => Australia/LHI
                [17] => Australia/LHI
                [18] => Asia/Magadan
                [19] => Asia/Magadan
                [20] => Pacific/Noumea
                [21] => Pacific/Norfolk
                [22] => Pacific/Nauru
                [23] => Pacific/Auckland
                [24] => NZ
                [25] => Asia/Kamchatka
                [26] => Asia/Sakhalin
                [27] => Asia/Sakhalin
                [28] => Pacific/Guadalcanal
                [29] => Asia/Vladivostok
                [30] => Pacific/Efate
            )
    
        [12] => Array
            (
                [0] => Asia/Anadyr
                [1] => Asia/Anadyr
                [2] => Pacific/Chatham
                [3] => NZ-CHAT
                [4] => Pacific/Fiji
                [5] => Pacific/Kosrae
                [6] => Asia/Magadan
                [7] => Pacific/Kwajalein
                [8] => Kwajalein
                [9] => Pacific/Majuro
                [10] => Pacific/Noumea
                [11] => Pacific/Nauru
                [12] => Pacific/Auckland
                [13] => Pacific/Auckland
                [14] => Pacific/Auckland
                [15] => Antarctica/McMurdo
                [16] => Antarctica/South_Pole
                [17] => NZ
                [18] => NZ
                [19] => NZ
                [20] => Asia/Kamchatka
                [21] => Asia/Kamchatka
                [22] => Asia/Sakhalin
                [23] => Pacific/Efate
            )
    
        [13] => Array
            (
                [0] => Asia/Anadyr
                [1] => Asia/Anadyr
                [2] => Pacific/Chatham
                [3] => NZ-CHAT
                [4] => Pacific/Fiji
                [5] => Pacific/Auckland
                [6] => Antarctica/McMurdo
                [7] => Antarctica/South_Pole
                [8] => NZ
                [9] => Asia/Kamchatka
                [10] => Pacific/Enderbury
                [11] => Pacific/Tongatapu
            )
    
        [14] => Array
            (
                [0] => Asia/Anadyr
                [1] => Pacific/Kiritimati
                [2] => Pacific/Tongatapu
            )
    
    )
    I assumed I was going to store the name of the zone with each user so that I could make use of the built-in localization in PHP's date/time functions to do things like check if DST is in effect.

    But some of the names appear in multiple offsets... like Pacific/Auckland in GMT+11, +12 and +13. If I set that as the default time zone for that user, what offset would be returned? Would it be correct? I don't know.

    Has anyone worked this out before that can advise?

  2. #2
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Maybe it would be easier and a better experience for both you and the user if you use a simple GMT selection?

    i.e
    Code:
    GMT -12
    GMT -11
    GMT -10
    GMT -9
    GMT -8
    GMT -7
    GMT -6
    GMT -5
    GMT -4
    GMT -3
    GMT -2
    GMT -1
    GMT
    GMT +1
    GMT +2
    GMT +3
    GMT +4
    GMT +5
    GMT +6
    GMT +7
    GMT +8
    GMT +9
    GMT +10
    GMT +11
    GMT +12
    GMT +13
    GMT +14
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  3. #3
    SitePoint Wizard
    Join Date
    Nov 2005
    Posts
    1,191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dan Grossman View Post
    That seems excessive for a user to look through to find their time zone.
    There are only 48 possible time zones though (less perhaps, given that not many use the half hour thing). Is there a common way to identify these? Like looking for all cities/regions with GMT+1

    As far as checking if DST is correct, I think that's only as good as the DB you use (PHP default or otherwise), laws could change tomorrow.

    Quote Originally Posted by Dan Grossman View Post
    Pacific/Auckland in GMT+11, +12 and +13
    We are UTC +13 in summer, and +12 in winter (southern hemi that is). So only way you would get +11 is if UTC changed.

  4. #4
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've wondered about this and it's tricky. Perhaps you could use a two step question to determine their zone.
    I.e the first step asks the user for their continent (or IP lookup if you wish) and their GMT offset. You'd then display a list of timezone names +/- 1 hr from their specified offset and within their continent.

    As hash said there's no guarantee PHP will always be correct. Authorities vary when DST is effective (often the N sunday in X month). Western Australia just had its fourth referendum on whether to adopt DST or not and I know big events can affect when DST comes into affect. Keeping up to date with all DST zones world wide could be very difficult (or a good idea for a third party service).

    If you can accept a compromise maybe finding the best named timezone with the option for users to specify an actual offset to override in exceptional circumstances would work. Or perhaps you render all dates as GMT and use some JS to format according to their locale?

  5. #5
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by arkinstall View Post
    Maybe it would be easier and a better experience for both you and the user if you use a simple GMT selection?
    Then you know nothing about DST and the time becomes incorrect for part of the year.

    I also did a quick street test and most people (Americans at least) can't correctly tell you the GMT offset for their time zone.

    There must be a good way to do this, so many websites do time zones correctly!

  6. #6
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  7. #7
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Dan, how important is this? Is this a business requirement or a nice-to-have? If it's the latter, could you not just allow the user to set their local time(not zone) themselves in a control panel-esk way?
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  8. #8
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Damn it Jake!
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  9. #9
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by arkinstall View Post
    Not helpful unless you're going to share the code they're using for the "automatically detect DST"

    Quote Originally Posted by SilverBulletUK
    Dan, how important is this? Is this a business requirement or a nice-to-have?
    It's necessary that I allow users to select a time zone. What I'm struggling with is how to present a non-ginormous list of time zones to choose from, and how to adjust the user's time for DST.

    Right now, for testing, I have a dropdown like vBulletin's with GMT offsets listed, but I don't know how to handle the DST part from that. DST rules are very different for different regions within the same GMT offset.

  10. #10
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Dan, this seems like a nice little gem hidden away.
    It is updated periodically to reflect changes made by political bodies to time zone boundaries, UTC offsets, and daylight-saving rules. This database (often called tz or zoneinfo) is used by several implementations, including the GNU C Library used in GNU/Linux, FreeBSD, NetBSD, OpenBSD, Cygwin, DJGPP, AIX, Mac OS X, OpenVMS, Oracle Database, Solaris, Tru64, and UnixWare.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  11. #11
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SilverBulletUK View Post
    Dan, this seems like a nice little gem hidden away.
    That's essentially what the list in the first post is, the problem is, zoneinfo contains so many time zone names, and I've never seen a site that makes you scroll through 100 names to choose a time zone

    Maybe I should just arbitrarily pick a subset

    Like Windows did, apparently:

    http://www.unicode.org/cldr/data/doc...dows%5Fids
    Last edited by Dan Grossman; May 28, 2009 at 12:29.

  12. #12
    SitePoint Wizard
    Join Date
    Jan 2001
    Location
    Grand Rapids, MI
    Posts
    1,284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dan,

    I'm not sure if this is what your looking for, but I bookmark'ed this awhile ago:

    http://derickrethans.nl/files/time-phpworks8.pdf (PDF Link)

    Hope it helps.

  13. #13
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks Ben, that has some good examples of converting between time zones in PHP 5.2+

    I think I've settled on a solution

    Code:
    Array
    (
        [Etc/GMT+12] => (GMT-12:00) International Date Line West
        [Pacific/Apia] => (GMT-11:00) Midway Island, Samoa
        [Pacific/Honolulu] => (GMT-10:00) Hawaii
        [America/Anchorage] => (GMT-09:00) Alaska
        [America/Los_Angeles] => (GMT-08:00) Pacific Time (US & Canada); Tijuana
        [America/Phoenix] => (GMT-07:00) Arizona
        [America/Denver] => (GMT-07:00) Mountain Time (US & Canada)
        [America/Chihuahua] => (GMT-07:00) Chihuahua, La Paz, Mazatlan
        [America/Managua] => (GMT-06:00) Central America
        [America/Regina] => (GMT-06:00) Saskatchewan
        [America/Mexico_City] => (GMT-06:00) Guadalajara, Mexico City, Monterrey
        [America/Chicago] => (GMT-06:00) Central Time (US & Canada)
        [America/Indianapolis] => (GMT-05:00) Indiana (East)
        [America/Bogota] => (GMT-05:00) Bogota, Lima, Quito
        [America/New_York] => (GMT-05:00) Eastern Time (US & Canada)
        [America/Caracas] => (GMT-04:00) Caracas, La Paz
        [America/Santiago] => (GMT-04:00) Santiago
        [America/Halifax] => (GMT-04:00) Atlantic Time (Canada)
        [America/St_Johns] => (GMT-03:30) Newfoundland
        [America/Buenos_Aires] => (GMT-03:00) Buenos Aires, Georgetown
        [America/Godthab] => (GMT-03:00) Greenland
        [America/Sao_Paulo] => (GMT-03:00) Brasilia
        [America/Noronha] => (GMT-02:00) Mid-Atlantic
        [Atlantic/Cape_Verde] => (GMT-01:00) Cape Verde Is.
        [Atlantic/Azores] => (GMT-01:00) Azores
        [Africa/Casablanca] => (GMT) Casablanca, Monrovia
        [Europe/London] => (GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London
        [Africa/Lagos] => (GMT+01:00) West Central Africa
        [Europe/Berlin] => (GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
        [Europe/Paris] => (GMT+01:00) Brussels, Copenhagen, Madrid, Paris
        [Europe/Sarajevo] => (GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb
        [Europe/Belgrade] => (GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague
        [Africa/Johannesburg] => (GMT+02:00) Harare, Pretoria
        [Asia/Jerusalem] => (GMT+02:00) Jerusalem
        [Europe/Istanbul] => (GMT+02:00) Athens, Istanbul, Minsk
        [Europe/Helsinki] => (GMT+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius
        [Africa/Cairo] => (GMT+02:00) Cairo
        [Europe/Bucharest] => (GMT+02:00) Bucharest
        [Africa/Nairobi] => (GMT+03:00) Nairobi
        [Asia/Riyadh] => (GMT+03:00) Kuwait, Riyadh
        [Europe/Moscow] => (GMT+03:00) Moscow, St. Petersburg, Volgograd
        [Asia/Baghdad] => (GMT+03:00) Baghdad
        [Asia/Tehran] => (GMT+03:30) Tehran
        [Asia/Muscat] => (GMT+04:00) Abu Dhabi, Muscat
        [Asia/Tbilisi] => (GMT+04:00) Baku, Tbilisi, Yerevan
        [Asia/Kabul] => (GMT+04:30) Kabul
        [Asia/Karachi] => (GMT+05:00) Islamabad, Karachi, Tashkent
        [Asia/Yekaterinburg] => (GMT+05:00) Ekaterinburg
        [Asia/Calcutta] => (GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi
        [Asia/Katmandu] => (GMT+05:45) Kathmandu
        [Asia/Colombo] => (GMT+06:00) Sri Jayawardenepura
        [Asia/Dhaka] => (GMT+06:00) Astana, Dhaka
        [Asia/Novosibirsk] => (GMT+06:00) Almaty, Novosibirsk
        [Asia/Rangoon] => (GMT+06:30) Rangoon
        [Asia/Bangkok] => (GMT+07:00) Bangkok, Hanoi, Jakarta
        [Asia/Krasnoyarsk] => (GMT+07:00) Krasnoyarsk
        [Australia/Perth] => (GMT+08:00) Perth
        [Asia/Taipei] => (GMT+08:00) Taipei
        [Asia/Singapore] => (GMT+08:00) Kuala Lumpur, Singapore
        [Asia/Hong_Kong] => (GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi
        [Asia/Irkutsk] => (GMT+08:00) Irkutsk, Ulaan Bataar
        [Asia/Tokyo] => (GMT+09:00) Osaka, Sapporo, Tokyo
        [Asia/Seoul] => (GMT+09:00) Seoul
        [Asia/Yakutsk] => (GMT+09:00) Yakutsk
        [Australia/Darwin] => (GMT+09:30) Darwin
        [Australia/Adelaide] => (GMT+09:30) Adelaide
        [Pacific/Guam] => (GMT+10:00) Guam, Port Moresby
        [Australia/Brisbane] => (GMT+10:00) Brisbane
        [Asia/Vladivostok] => (GMT+10:00) Vladivostok
        [Australia/Hobart] => (GMT+10:00) Hobart
        [Australia/Sydney] => (GMT+10:00) Canberra, Melbourne, Sydney
        [Asia/Magadan] => (GMT+11:00) Magadan, Solomon Is., New Caledonia
        [Pacific/Fiji] => (GMT+12:00) Fiji, Kamchatka, Marshall Is.
        [Pacific/Auckland] => (GMT+12:00) Auckland, Wellington
        [Pacific/Tongatapu] => (GMT+13:00) Nuku'alofa
    )
    Using the subset of time zones Windows supports from the page I linked in my last post, I created this array, which maps the user selection to a named time zone I can use to adjust for DST. It may not be 100% accurate everywhere, but it will be most of the time, and can make use of the PECL timezone database updates.

  14. #14
    SitePoint Wizard
    Join Date
    Mar 2008
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can pre-select the timezone with some JavaScript, though you can't simply use Date.getTimezoneOffset() because it doesn't inform you if it's DST or not.

  15. #15
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    I think you can let PHP handle the inner workings of DST and repeated timezones by using DateTimeZone.

    PHP Code:
    <?php

    $tz 
    = new DateTimeZone'America/Los_Angeles' );
    $dt = new DateTime'now'$tz );

    print 
    $dt->format'c' );
    I would assume it would handle all of those for you.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  16. #16
    SitePoint Guru rageh's Avatar
    Join Date
    Apr 2006
    Location
    London, Formerly Somalia
    Posts
    612
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dan Grossman View Post
    Then you know nothing about DST and the time becomes incorrect for part of the year.

    I also did a quick street test and most people (Americans at least) can't correctly tell you the GMT offset for their time zone.
    Dan, do you realize that most non-americans are not familiar with DST either?
    ------------------

  17. #17
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by rageh View Post
    Dan, do you realize that most non-americans are not familiar with DST either?
    I wouldn't know either way. I said Americans because a street test (asking people on the street) only lets me ask locals, which are American.

    Quote Originally Posted by logic_earth View Post
    I think you can let PHP handle the interworkings of DST and repeated timezones but using DateTimeZone.
    Yep, that's why I was trying to get to a good list of named time zones instead of GMT offsets. It's too bad all the fun new date/time handling that's time zone aware in PHP requires 5.2+, which most hosts don't yet support, but that's alright unless I decide to sell this code down the line. Right now it's hosted so I'm happy to hack up a PHP 5.2 install even though RHEL doesn't officially support it yet.

  18. #18
    SitePoint Guru rageh's Avatar
    Join Date
    Apr 2006
    Location
    London, Formerly Somalia
    Posts
    612
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dan Grossman View Post
    I wouldn't know either way. I said Americans because a street test (asking people on the street) only lets me ask locals, which are American.
    I don't mean non-americans in America. But rather people in Europe, Asia and Africa. When you mention DST, they would not know what you are talking about. The GMT fares better though. More people are familiar with it than DST.
    ------------------

  19. #19
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That was Dan's point. He physically asked people in the street, which means none of them were in Europe, Asia or Africa at the time. They were all in America.

    Using the GMT offset directly means users would need to change that setting when DST came into and out of effect, or see wrong times.

  20. #20
    SitePoint Guru rageh's Avatar
    Join Date
    Apr 2006
    Location
    London, Formerly Somalia
    Posts
    612
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cranial-bore View Post
    That was Dan's point. He physically asked people in the street, which means none of them were in Europe, Asia or Africa at the time. They were all in America.
    I know that. I was making a general point as regards familiarity of the term outside USA. He wouldn't know what people ouside US are familiar or unfamilar.
    ------------------


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •