annotate plugins/libcalendaring/lib/Sabre/VObject/TimeZoneUtil.php @ 4:888e774ee983

libcalendar plugin as distributed
author Charlie Root
date Sat, 13 Jan 2018 08:57:56 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
1 <?php
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
2
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
3 namespace Sabre\VObject;
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
4
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
5 /**
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
6 * Time zone name translation
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
7 *
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
8 * This file translates well-known time zone names into "Olson database" time zone names.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
9 *
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
10 * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/).
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
11 * @author Frank Edelhaeuser (fedel@users.sourceforge.net)
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
12 * @author Evert Pot (http://evertpot.com/)
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
13 * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
14 */
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
15 class TimeZoneUtil {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
16
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
17 public static $map = array(
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
18
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
19 // from http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/zone_tzid.html
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
20 // snapshot taken on 2012/01/16
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
21
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
22 // windows
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
23 'AUS Central Standard Time'=>'Australia/Darwin',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
24 'AUS Eastern Standard Time'=>'Australia/Sydney',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
25 'Afghanistan Standard Time'=>'Asia/Kabul',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
26 'Alaskan Standard Time'=>'America/Anchorage',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
27 'Arab Standard Time'=>'Asia/Riyadh',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
28 'Arabian Standard Time'=>'Asia/Dubai',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
29 'Arabic Standard Time'=>'Asia/Baghdad',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
30 'Argentina Standard Time'=>'America/Buenos_Aires',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
31 'Armenian Standard Time'=>'Asia/Yerevan',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
32 'Atlantic Standard Time'=>'America/Halifax',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
33 'Azerbaijan Standard Time'=>'Asia/Baku',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
34 'Azores Standard Time'=>'Atlantic/Azores',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
35 'Bangladesh Standard Time'=>'Asia/Dhaka',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
36 'Canada Central Standard Time'=>'America/Regina',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
37 'Cape Verde Standard Time'=>'Atlantic/Cape_Verde',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
38 'Caucasus Standard Time'=>'Asia/Yerevan',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
39 'Cen. Australia Standard Time'=>'Australia/Adelaide',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
40 'Central America Standard Time'=>'America/Guatemala',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
41 'Central Asia Standard Time'=>'Asia/Almaty',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
42 'Central Brazilian Standard Time'=>'America/Cuiaba',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
43 'Central Europe Standard Time'=>'Europe/Budapest',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
44 'Central European Standard Time'=>'Europe/Warsaw',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
45 'Central Pacific Standard Time'=>'Pacific/Guadalcanal',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
46 'Central Standard Time'=>'America/Chicago',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
47 'Central Standard Time (Mexico)'=>'America/Mexico_City',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
48 'China Standard Time'=>'Asia/Shanghai',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
49 'Dateline Standard Time'=>'Etc/GMT+12',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
50 'E. Africa Standard Time'=>'Africa/Nairobi',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
51 'E. Australia Standard Time'=>'Australia/Brisbane',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
52 'E. Europe Standard Time'=>'Europe/Minsk',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
53 'E. South America Standard Time'=>'America/Sao_Paulo',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
54 'Eastern Standard Time'=>'America/New_York',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
55 'Egypt Standard Time'=>'Africa/Cairo',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
56 'Ekaterinburg Standard Time'=>'Asia/Yekaterinburg',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
57 'FLE Standard Time'=>'Europe/Kiev',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
58 'Fiji Standard Time'=>'Pacific/Fiji',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
59 'GMT Standard Time'=>'Europe/London',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
60 'GTB Standard Time'=>'Europe/Istanbul',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
61 'Georgian Standard Time'=>'Asia/Tbilisi',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
62 'Greenland Standard Time'=>'America/Godthab',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
63 'Greenwich Standard Time'=>'Atlantic/Reykjavik',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
64 'Hawaiian Standard Time'=>'Pacific/Honolulu',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
65 'India Standard Time'=>'Asia/Calcutta',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
66 'Iran Standard Time'=>'Asia/Tehran',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
67 'Israel Standard Time'=>'Asia/Jerusalem',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
68 'Jordan Standard Time'=>'Asia/Amman',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
69 'Kamchatka Standard Time'=>'Asia/Kamchatka',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
70 'Korea Standard Time'=>'Asia/Seoul',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
71 'Magadan Standard Time'=>'Asia/Magadan',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
72 'Mauritius Standard Time'=>'Indian/Mauritius',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
73 'Mexico Standard Time'=>'America/Mexico_City',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
74 'Mexico Standard Time 2'=>'America/Chihuahua',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
75 'Mid-Atlantic Standard Time'=>'Etc/GMT-2',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
76 'Middle East Standard Time'=>'Asia/Beirut',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
77 'Montevideo Standard Time'=>'America/Montevideo',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
78 'Morocco Standard Time'=>'Africa/Casablanca',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
79 'Mountain Standard Time'=>'America/Denver',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
80 'Mountain Standard Time (Mexico)'=>'America/Chihuahua',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
81 'Myanmar Standard Time'=>'Asia/Rangoon',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
82 'N. Central Asia Standard Time'=>'Asia/Novosibirsk',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
83 'Namibia Standard Time'=>'Africa/Windhoek',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
84 'Nepal Standard Time'=>'Asia/Katmandu',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
85 'New Zealand Standard Time'=>'Pacific/Auckland',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
86 'Newfoundland Standard Time'=>'America/St_Johns',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
87 'North Asia East Standard Time'=>'Asia/Irkutsk',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
88 'North Asia Standard Time'=>'Asia/Krasnoyarsk',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
89 'Pacific SA Standard Time'=>'America/Santiago',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
90 'Pacific Standard Time'=>'America/Los_Angeles',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
91 'Pacific Standard Time (Mexico)'=>'America/Santa_Isabel',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
92 'Pakistan Standard Time'=>'Asia/Karachi',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
93 'Paraguay Standard Time'=>'America/Asuncion',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
94 'Romance Standard Time'=>'Europe/Paris',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
95 'Russian Standard Time'=>'Europe/Moscow',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
96 'SA Eastern Standard Time'=>'America/Cayenne',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
97 'SA Pacific Standard Time'=>'America/Bogota',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
98 'SA Western Standard Time'=>'America/La_Paz',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
99 'SE Asia Standard Time'=>'Asia/Bangkok',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
100 'Samoa Standard Time'=>'Pacific/Apia',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
101 'Singapore Standard Time'=>'Asia/Singapore',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
102 'South Africa Standard Time'=>'Africa/Johannesburg',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
103 'Sri Lanka Standard Time'=>'Asia/Colombo',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
104 'Syria Standard Time'=>'Asia/Damascus',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
105 'Taipei Standard Time'=>'Asia/Taipei',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
106 'Tasmania Standard Time'=>'Australia/Hobart',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
107 'Tokyo Standard Time'=>'Asia/Tokyo',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
108 'Tonga Standard Time'=>'Pacific/Tongatapu',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
109 'US Eastern Standard Time'=>'America/Indianapolis',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
110 'US Mountain Standard Time'=>'America/Phoenix',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
111 'UTC+12'=>'Etc/GMT-12',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
112 'UTC-02'=>'Etc/GMT+2',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
113 'UTC-11'=>'Etc/GMT+11',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
114 'Ulaanbaatar Standard Time'=>'Asia/Ulaanbaatar',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
115 'Venezuela Standard Time'=>'America/Caracas',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
116 'Vladivostok Standard Time'=>'Asia/Vladivostok',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
117 'W. Australia Standard Time'=>'Australia/Perth',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
118 'W. Central Africa Standard Time'=>'Africa/Lagos',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
119 'W. Europe Standard Time'=>'Europe/Berlin',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
120 'West Asia Standard Time'=>'Asia/Tashkent',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
121 'West Pacific Standard Time'=>'Pacific/Port_Moresby',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
122 'Yakutsk Standard Time'=>'Asia/Yakutsk',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
123
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
124 // Microsoft exchange timezones
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
125 // Source:
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
126 // http://msdn.microsoft.com/en-us/library/ms988620%28v=exchg.65%29.aspx
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
127 //
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
128 // Correct timezones deduced with help from:
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
129 // http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
130 'Universal Coordinated Time' => 'UTC',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
131 'Casablanca, Monrovia' => 'Africa/Casablanca',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
132 'Greenwich Mean Time: Dublin, Edinburgh, Lisbon, London' => 'Europe/Lisbon',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
133 'Greenwich Mean Time; Dublin, Edinburgh, London' => 'Europe/London',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
134 'Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna' => 'Europe/Berlin',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
135 'Belgrade, Pozsony, Budapest, Ljubljana, Prague' => 'Europe/Prague',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
136 'Brussels, Copenhagen, Madrid, Paris' => 'Europe/Paris',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
137 'Paris, Madrid, Brussels, Copenhagen' => 'Europe/Paris',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
138 'Prague, Central Europe' => 'Europe/Prague',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
139 'Sarajevo, Skopje, Sofija, Vilnius, Warsaw, Zagreb' => 'Europe/Sarajevo',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
140 'West Central Africa' => 'Africa/Luanda', // This was a best guess
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
141 'Athens, Istanbul, Minsk' => 'Europe/Athens',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
142 'Bucharest' => 'Europe/Bucharest',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
143 'Cairo' => 'Africa/Cairo',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
144 'Harare, Pretoria' => 'Africa/Harare',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
145 'Helsinki, Riga, Tallinn' => 'Europe/Helsinki',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
146 'Israel, Jerusalem Standard Time' => 'Asia/Jerusalem',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
147 'Baghdad' => 'Asia/Baghdad',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
148 'Arab, Kuwait, Riyadh' => 'Asia/Kuwait',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
149 'Moscow, St. Petersburg, Volgograd' => 'Europe/Moscow',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
150 'East Africa, Nairobi' => 'Africa/Nairobi',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
151 'Tehran' => 'Asia/Tehran',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
152 'Abu Dhabi, Muscat' => 'Asia/Muscat', // Best guess
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
153 'Baku, Tbilisi, Yerevan' => 'Asia/Baku',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
154 'Kabul' => 'Asia/Kabul',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
155 'Ekaterinburg' => 'Asia/Yekaterinburg',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
156 'Islamabad, Karachi, Tashkent' => 'Asia/Karachi',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
157 'Kolkata, Chennai, Mumbai, New Delhi, India Standard Time' => 'Asia/Calcutta',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
158 'Kathmandu, Nepal' => 'Asia/Kathmandu',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
159 'Almaty, Novosibirsk, North Central Asia' => 'Asia/Almaty',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
160 'Astana, Dhaka' => 'Asia/Dhaka',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
161 'Sri Jayawardenepura, Sri Lanka' => 'Asia/Colombo',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
162 'Rangoon' => 'Asia/Rangoon',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
163 'Bangkok, Hanoi, Jakarta' => 'Asia/Bangkok',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
164 'Krasnoyarsk' => 'Asia/Krasnoyarsk',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
165 'Beijing, Chongqing, Hong Kong SAR, Urumqi' => 'Asia/Shanghai',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
166 'Irkutsk, Ulaan Bataar' => 'Asia/Irkutsk',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
167 'Kuala Lumpur, Singapore' => 'Asia/Singapore',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
168 'Perth, Western Australia' => 'Australia/Perth',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
169 'Taipei' => 'Asia/Taipei',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
170 'Osaka, Sapporo, Tokyo' => 'Asia/Tokyo',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
171 'Seoul, Korea Standard time' => 'Asia/Seoul',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
172 'Yakutsk' => 'Asia/Yakutsk',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
173 'Adelaide, Central Australia' => 'Australia/Adelaide',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
174 'Darwin' => 'Australia/Darwin',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
175 'Brisbane, East Australia' => 'Australia/Brisbane',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
176 'Canberra, Melbourne, Sydney, Hobart (year 2000 only)' => 'Australia/Sydney',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
177 'Guam, Port Moresby' => 'Pacific/Guam',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
178 'Hobart, Tasmania' => 'Australia/Hobart',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
179 'Vladivostok' => 'Asia/Vladivostok',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
180 'Magadan, Solomon Is., New Caledonia' => 'Asia/Magadan',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
181 'Auckland, Wellington' => 'Pacific/Auckland',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
182 'Fiji Islands, Kamchatka, Marshall Is.' => 'Pacific/Fiji',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
183 'Nuku\'alofa, Tonga' => 'Pacific/Tongatapu',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
184 'Azores' => 'Atlantic/Azores',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
185 'Cape Verde Is.' => 'Atlantic/Cape_Verde',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
186 'Mid-Atlantic' => 'America/Noronha',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
187 'Brasilia' => 'America/Sao_Paulo', // Best guess
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
188 'Buenos Aires' => 'America/Argentina/Buenos_Aires',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
189 'Greenland' => 'America/Godthab',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
190 'Newfoundland' => 'America/St_Johns',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
191 'Atlantic Time (Canada)' => 'America/Halifax',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
192 'Caracas, La Paz' => 'America/Caracas',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
193 'Santiago' => 'America/Santiago',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
194 'Bogota, Lima, Quito' => 'America/Bogota',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
195 'Eastern Time (US & Canada)' => 'America/New_York',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
196 'Indiana (East)' => 'America/Indiana/Indianapolis',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
197 'Central America' => 'America/Guatemala',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
198 'Central Time (US & Canada)' => 'America/Chicago',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
199 'Mexico City, Tegucigalpa' => 'America/Mexico_City',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
200 'Saskatchewan' => 'America/Edmonton',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
201 'Arizona' => 'America/Phoenix',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
202 'Mountain Time (US & Canada)' => 'America/Denver', // Best guess
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
203 'Pacific Time (US & Canada); Tijuana' => 'America/Los_Angeles', // Best guess
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
204 'Alaska' => 'America/Anchorage',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
205 'Hawaii' => 'Pacific/Honolulu',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
206 'Midway Island, Samoa' => 'Pacific/Midway',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
207 'Eniwetok, Kwajalein, Dateline Time' => 'Pacific/Kwajalein',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
208
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
209 // The following list are timezone names that could be generated by
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
210 // Lotus / Domino
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
211 'Dateline' => 'Etc/GMT-12',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
212 'Samoa' => 'Pacific/Apia',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
213 'Hawaiian' => 'Pacific/Honolulu',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
214 'Alaskan' => 'America/Anchorage',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
215 'Pacific' => 'America/Los_Angeles',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
216 'Pacific Standard Time' => 'America/Los_Angeles',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
217 'Mexico Standard Time 2' => 'America/Chihuahua',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
218 'Mountain' => 'America/Denver',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
219 'Mountain Standard Time' => 'America/Chihuahua',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
220 'US Mountain' => 'America/Phoenix',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
221 'Canada Central' => 'America/Edmonton',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
222 'Central America' => 'America/Guatemala',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
223 'Central' => 'America/Chicago',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
224 'Central Standard Time' => 'America/Mexico_City',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
225 'Mexico' => 'America/Mexico_City',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
226 'Eastern' => 'America/New_York',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
227 'SA Pacific' => 'America/Bogota',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
228 'US Eastern' => 'America/Indiana/Indianapolis',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
229 'Venezuela' => 'America/Caracas',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
230 'Atlantic' => 'America/Halifax',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
231 'Central Brazilian' => 'America/Manaus',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
232 'Pacific SA' => 'America/Santiago',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
233 'SA Western' => 'America/La_Paz',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
234 'Newfoundland' => 'America/St_Johns',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
235 'Argentina' => 'America/Argentina/Buenos_Aires',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
236 'E. South America' => 'America/Belem',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
237 'Greenland' => 'America/Godthab',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
238 'Montevideo' => 'America/Montevideo',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
239 'SA Eastern' => 'America/Belem',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
240 'Mid-Atlantic' => 'Etc/GMT-2',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
241 'Azores' => 'Atlantic/Azores',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
242 'Cape Verde' => 'Atlantic/Cape_Verde',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
243 'Greenwich' => 'Atlantic/Reykjavik', // No I'm serious.. Greenwich is not GMT.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
244 'Morocco' => 'Africa/Casablanca',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
245 'Central Europe' => 'Europe/Prague',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
246 'Central European' => 'Europe/Sarajevo',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
247 'Romance' => 'Europe/Paris',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
248 'W. Central Africa' => 'Africa/Lagos', // Best guess
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
249 'W. Europe' => 'Europe/Amsterdam',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
250 'E. Europe' => 'Europe/Minsk',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
251 'Egypt' => 'Africa/Cairo',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
252 'FLE' => 'Europe/Helsinki',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
253 'GTB' => 'Europe/Athens',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
254 'Israel' => 'Asia/Jerusalem',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
255 'Jordan' => 'Asia/Amman',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
256 'Middle East' => 'Asia/Beirut',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
257 'Namibia' => 'Africa/Windhoek',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
258 'South Africa' => 'Africa/Harare',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
259 'Arab' => 'Asia/Kuwait',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
260 'Arabic' => 'Asia/Baghdad',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
261 'E. Africa' => 'Africa/Nairobi',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
262 'Georgian' => 'Asia/Tbilisi',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
263 'Russian' => 'Europe/Moscow',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
264 'Iran' => 'Asia/Tehran',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
265 'Arabian' => 'Asia/Muscat',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
266 'Armenian' => 'Asia/Yerevan',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
267 'Azerbijan' => 'Asia/Baku',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
268 'Caucasus' => 'Asia/Yerevan',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
269 'Mauritius' => 'Indian/Mauritius',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
270 'Afghanistan' => 'Asia/Kabul',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
271 'Ekaterinburg' => 'Asia/Yekaterinburg',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
272 'Pakistan' => 'Asia/Karachi',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
273 'West Asia' => 'Asia/Tashkent',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
274 'India' => 'Asia/Calcutta',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
275 'Sri Lanka' => 'Asia/Colombo',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
276 'Nepal' => 'Asia/Kathmandu',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
277 'Central Asia' => 'Asia/Dhaka',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
278 'N. Central Asia' => 'Asia/Almaty',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
279 'Myanmar' => 'Asia/Rangoon',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
280 'North Asia' => 'Asia/Krasnoyarsk',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
281 'SE Asia' => 'Asia/Bangkok',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
282 'China' => 'Asia/Shanghai',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
283 'North Asia East' => 'Asia/Irkutsk',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
284 'Singapore' => 'Asia/Singapore',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
285 'Taipei' => 'Asia/Taipei',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
286 'W. Australia' => 'Australia/Perth',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
287 'Korea' => 'Asia/Seoul',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
288 'Tokyo' => 'Asia/Tokyo',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
289 'Yakutsk' => 'Asia/Yakutsk',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
290 'AUS Central' => 'Australia/Darwin',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
291 'Cen. Australia' => 'Australia/Adelaide',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
292 'AUS Eastern' => 'Australia/Sydney',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
293 'E. Australia' => 'Australia/Brisbane',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
294 'Tasmania' => 'Australia/Hobart',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
295 'Vladivostok' => 'Asia/Vladivostok',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
296 'West Pacific' => 'Pacific/Guam',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
297 'Central Pacific' => 'Asia/Magadan',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
298 'Fiji' => 'Pacific/Fiji',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
299 'New Zealand' => 'Pacific/Auckland',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
300 'Tonga' => 'Pacific/Tongatapu',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
301 );
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
302
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
303 /**
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
304 * List of microsoft exchange timezone ids.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
305 *
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
306 * Source: http://msdn.microsoft.com/en-us/library/aa563018(loband).aspx
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
307 */
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
308 public static $microsoftExchangeMap = array(
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
309 0 => 'UTC',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
310 31 => 'Africa/Casablanca',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
311
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
312 // Insanely, id #2 is used for both Europe/Lisbon, and Europe/Sarajevo.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
313 // I'm not even kidding.. We handle this special case in the
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
314 // getTimeZone method.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
315 2 => 'Europe/Lisbon',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
316 1 => 'Europe/London',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
317 4 => 'Europe/Berlin',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
318 6 => 'Europe/Prague',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
319 3 => 'Europe/Paris',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
320 69 => 'Africa/Luanda', // This was a best guess
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
321 7 => 'Europe/Athens',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
322 5 => 'Europe/Bucharest',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
323 49 => 'Africa/Cairo',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
324 50 => 'Africa/Harare',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
325 59 => 'Europe/Helsinki',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
326 27 => 'Asia/Jerusalem',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
327 26 => 'Asia/Baghdad',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
328 74 => 'Asia/Kuwait',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
329 51 => 'Europe/Moscow',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
330 56 => 'Africa/Nairobi',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
331 25 => 'Asia/Tehran',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
332 24 => 'Asia/Muscat', // Best guess
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
333 54 => 'Asia/Baku',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
334 48 => 'Asia/Kabul',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
335 58 => 'Asia/Yekaterinburg',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
336 47 => 'Asia/Karachi',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
337 23 => 'Asia/Calcutta',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
338 62 => 'Asia/Kathmandu',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
339 46 => 'Asia/Almaty',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
340 71 => 'Asia/Dhaka',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
341 66 => 'Asia/Colombo',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
342 61 => 'Asia/Rangoon',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
343 22 => 'Asia/Bangkok',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
344 64 => 'Asia/Krasnoyarsk',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
345 45 => 'Asia/Shanghai',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
346 63 => 'Asia/Irkutsk',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
347 21 => 'Asia/Singapore',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
348 73 => 'Australia/Perth',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
349 75 => 'Asia/Taipei',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
350 20 => 'Asia/Tokyo',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
351 72 => 'Asia/Seoul',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
352 70 => 'Asia/Yakutsk',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
353 19 => 'Australia/Adelaide',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
354 44 => 'Australia/Darwin',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
355 18 => 'Australia/Brisbane',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
356 76 => 'Australia/Sydney',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
357 43 => 'Pacific/Guam',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
358 42 => 'Australia/Hobart',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
359 68 => 'Asia/Vladivostok',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
360 41 => 'Asia/Magadan',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
361 17 => 'Pacific/Auckland',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
362 40 => 'Pacific/Fiji',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
363 67 => 'Pacific/Tongatapu',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
364 29 => 'Atlantic/Azores',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
365 53 => 'Atlantic/Cape_Verde',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
366 30 => 'America/Noronha',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
367 8 => 'America/Sao_Paulo', // Best guess
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
368 32 => 'America/Argentina/Buenos_Aires',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
369 60 => 'America/Godthab',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
370 28 => 'America/St_Johns',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
371 9 => 'America/Halifax',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
372 33 => 'America/Caracas',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
373 65 => 'America/Santiago',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
374 35 => 'America/Bogota',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
375 10 => 'America/New_York',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
376 34 => 'America/Indiana/Indianapolis',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
377 55 => 'America/Guatemala',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
378 11 => 'America/Chicago',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
379 37 => 'America/Mexico_City',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
380 36 => 'America/Edmonton',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
381 38 => 'America/Phoenix',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
382 12 => 'America/Denver', // Best guess
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
383 13 => 'America/Los_Angeles', // Best guess
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
384 14 => 'America/Anchorage',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
385 15 => 'Pacific/Honolulu',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
386 16 => 'Pacific/Midway',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
387 39 => 'Pacific/Kwajalein',
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
388 );
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
389
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
390 /**
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
391 * This method will try to find out the correct timezone for an iCalendar
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
392 * date-time value.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
393 *
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
394 * You must pass the contents of the TZID parameter, as well as the full
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
395 * calendar.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
396 *
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
397 * If the lookup fails, this method will return the default PHP timezone
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
398 * (as configured using date_default_timezone_set, or the date.timezone ini
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
399 * setting).
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
400 *
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
401 * Alternatively, if $failIfUncertain is set to true, it will throw an
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
402 * exception if we cannot accurately determine the timezone.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
403 *
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
404 * @param string $tzid
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
405 * @param Sabre\VObject\Component $vcalendar
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
406 * @return DateTimeZone
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
407 */
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
408 static public function getTimeZone($tzid, Component $vcalendar = null, $failIfUncertain = false) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
409
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
410 // First we will just see if the tzid is a support timezone identifier.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
411 try {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
412 return new \DateTimeZone($tzid);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
413 } catch (\Exception $e) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
414 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
415
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
416 // Next, we check if the tzid is somewhere in our tzid map.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
417 if (isset(self::$map[$tzid])) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
418 return new \DateTimeZone(self::$map[$tzid]);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
419 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
420
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
421 // Maybe the author was hyper-lazy and just included an offset. We
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
422 // support it, but we aren't happy about it.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
423 if (preg_match('/^GMT(\+|-)([0-9]{4})$/', $tzid, $matches)) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
424 return new \DateTimeZone('Etc/GMT' . $matches[1] . ltrim(substr($matches[2],0,2),'0'));
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
425 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
426
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
427 if ($vcalendar) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
428
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
429 // If that didn't work, we will scan VTIMEZONE objects
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
430 foreach($vcalendar->select('VTIMEZONE') as $vtimezone) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
431
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
432 if ((string)$vtimezone->TZID === $tzid) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
433
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
434 // Some clients add 'X-LIC-LOCATION' with the olson name.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
435 if (isset($vtimezone->{'X-LIC-LOCATION'})) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
436
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
437 $lic = (string)$vtimezone->{'X-LIC-LOCATION'};
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
438
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
439 // Libical generators may specify strings like
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
440 // "SystemV/EST5EDT". For those we must remove the
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
441 // SystemV part.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
442 if (substr($lic,0,8)==='SystemV/') {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
443 $lic = substr($lic,8);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
444 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
445
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
446 try {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
447 return new \DateTimeZone($lic);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
448 } catch (\Exception $e) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
449 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
450
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
451 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
452 // Microsoft may add a magic number, which we also have an
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
453 // answer for.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
454 if (isset($vtimezone->{'X-MICROSOFT-CDO-TZID'})) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
455 $cdoId = (int)$vtimezone->{'X-MICROSOFT-CDO-TZID'}->value;
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
456
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
457 // 2 can mean both Europe/Lisbon and Europe/Sarajevo.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
458 if ($cdoId===2 && strpos((string)$vtimezone->TZID, 'Sarajevo')!==false) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
459 return new \DateTimeZone('Europe/Sarajevo');
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
460 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
461
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
462 if (isset(self::$microsoftExchangeMap[$cdoId])) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
463 return new \DateTimeZone(self::$microsoftExchangeMap[$cdoId]);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
464 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
465 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
466
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
467 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
468
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
469 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
470
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
471 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
472
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
473 if ($failIfUncertain) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
474 throw new \InvalidArgumentException('We were unable to determine the correct PHP timezone for tzid: ' . $tzid);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
475 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
476
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
477 // If we got all the way here, we default to UTC.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
478 return new \DateTimeZone(date_default_timezone_get());
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
479
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
480 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
481
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
482 }