2
Copyright (C) 2002 MySQL AB
4
This program is free software; you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or
7
(at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with this program; if not, write to the Free Software
16
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
package com.mysql.jdbc;
22
import java.sql.Timestamp;
24
import java.util.Calendar;
25
import java.util.Collections;
26
import java.util.HashMap;
28
import java.util.TimeZone;
32
* Timezone conversion routines
34
* @author Mark Matthews
36
public class TimeUtil {
37
static final TimeZone GMT_TIMEZONE = TimeZone.getTimeZone("GMT");
38
static final Map TIMEZONE_MAPPINGS;
39
static final Map ABBREVIATED_TIMEZONES;
42
HashMap tempMap = new HashMap();
47
tempMap.put("Romance", "Europe/Paris");
48
tempMap.put("Romance Standard Time", "Europe/Paris");
49
tempMap.put("Warsaw", "Europe/Warsaw");
50
tempMap.put("Central Europe", "Europe/Prague");
51
tempMap.put("Central Europe Standard Time", "Europe/Prague");
52
tempMap.put("Prague Bratislava", "Europe/Prague");
53
tempMap.put("W. Central Africa Standard Time", "Africa/Luanda");
54
tempMap.put("FLE", "Europe/Helsinki");
55
tempMap.put("FLE Standard Time", "Europe/Helsinki");
56
tempMap.put("GFT", "Europe/Athens");
57
tempMap.put("GFT Standard Time", "Europe/Athens");
58
tempMap.put("GTB", "Europe/Athens");
59
tempMap.put("GTB Standard Time", "Europe/Athens");
60
tempMap.put("Israel", "Asia/Jerusalem");
61
tempMap.put("Israel Standard Time", "Asia/Jerusalem");
62
tempMap.put("Arab", "Asia/Riyadh");
63
tempMap.put("Arab Standard Time", "Asia/Riyadh");
64
tempMap.put("Arabic Standard Time", "Asia/Baghdad");
65
tempMap.put("E. Africa", "Africa/Nairobi");
66
tempMap.put("E. Africa Standard Time", "Africa/Nairobi");
67
tempMap.put("Saudi Arabia", "Asia/Riyadh");
68
tempMap.put("Saudi Arabia Standard Time", "Asia/Riyadh");
69
tempMap.put("Iran", "Asia/Tehran");
70
tempMap.put("Iran Standard Time", "Asia/Tehran");
71
tempMap.put("Afghanistan", "Asia/Kabul");
72
tempMap.put("Afghanistan Standard Time", "Asia/Kabul");
73
tempMap.put("India", "Asia/Calcutta");
74
tempMap.put("India Standard Time", "Asia/Calcutta");
75
tempMap.put("Myanmar Standard Time", "Asia/Rangoon");
76
tempMap.put("Nepal Standard Time", "Asia/Katmandu");
77
tempMap.put("Sri Lanka", "Asia/Colombo");
78
tempMap.put("Sri Lanka Standard Time", "Asia/Colombo");
79
tempMap.put("Beijing", "Asia/Shanghai");
80
tempMap.put("China", "Asia/Shanghai");
81
tempMap.put("China Standard Time", "Asia/Shanghai");
82
tempMap.put("AUS Central", "Australia/Darwin");
83
tempMap.put("AUS Central Standard Time", "Australia/Darwin");
84
tempMap.put("Cen. Australia", "Australia/Adelaide");
85
tempMap.put("Cen. Australia Standard Time", "Australia/Adelaide");
86
tempMap.put("Vladivostok", "Asia/Vladivostok");
87
tempMap.put("Vladivostok Standard Time", "Asia/Vladivostok");
88
tempMap.put("West Pacific", "Pacific/Guam");
89
tempMap.put("West Pacific Standard Time", "Pacific/Guam");
90
tempMap.put("E. South America", "America/Sao_Paulo");
91
tempMap.put("E. South America Standard Time", "America/Sao_Paulo");
92
tempMap.put("Greenland Standard Time", "America/Godthab");
93
tempMap.put("Newfoundland", "America/St_Johns");
94
tempMap.put("Newfoundland Standard Time", "America/St_Johns");
95
tempMap.put("Pacific SA", "America/Caracas");
96
tempMap.put("Pacific SA Standard Time", "America/Caracas");
97
tempMap.put("SA Western", "America/Caracas");
98
tempMap.put("SA Western Standard Time", "America/Caracas");
99
tempMap.put("SA Pacific", "America/Bogota");
100
tempMap.put("SA Pacific Standard Time", "America/Bogota");
101
tempMap.put("US Eastern", "America/Indianapolis");
102
tempMap.put("US Eastern Standard Time", "America/Indianapolis");
103
tempMap.put("Central America Standard Time", "America/Regina");
104
tempMap.put("Mexico", "America/Mexico_City");
105
tempMap.put("Mexico Standard Time", "America/Mexico_City");
106
tempMap.put("Canada Central", "America/Regina");
107
tempMap.put("Canada Central Standard Time", "America/Regina");
108
tempMap.put("US Mountain", "America/Phoenix");
109
tempMap.put("US Mountain Standard Time", "America/Phoenix");
110
tempMap.put("GMT", "Europe/London");
111
tempMap.put("GMT Standard Time", "Europe/London");
112
tempMap.put("Ekaterinburg", "Asia/Yekaterinburg");
113
tempMap.put("Ekaterinburg Standard Time", "Asia/Yekaterinburg");
114
tempMap.put("West Asia", "Asia/Karachi");
115
tempMap.put("West Asia Standard Time", "Asia/Karachi");
116
tempMap.put("Central Asia", "Asia/Dhaka");
117
tempMap.put("Central Asia Standard Time", "Asia/Dhaka");
118
tempMap.put("N. Central Asia Standard Time", "Asia/Novosibirsk");
119
tempMap.put("Bangkok", "Asia/Bangkok");
120
tempMap.put("Bangkok Standard Time", "Asia/Bangkok");
121
tempMap.put("North Asia Standard Time", "Asia/Krasnoyarsk");
122
tempMap.put("SE Asia", "Asia/Bangkok");
123
tempMap.put("SE Asia Standard Time", "Asia/Bangkok");
124
tempMap.put("North Asia East Standard Time", "Asia/Ulaanbaatar");
125
tempMap.put("Singapore", "Asia/Singapore");
126
tempMap.put("Singapore Standard Time", "Asia/Singapore");
127
tempMap.put("Taipei", "Asia/Taipei");
128
tempMap.put("Taipei Standard Time", "Asia/Taipei");
129
tempMap.put("W. Australia", "Australia/Perth");
130
tempMap.put("W. Australia Standard Time", "Australia/Perth");
131
tempMap.put("Korea", "Asia/Seoul");
132
tempMap.put("Korea Standard Time", "Asia/Seoul");
133
tempMap.put("Tokyo", "Asia/Tokyo");
134
tempMap.put("Tokyo Standard Time", "Asia/Tokyo");
135
tempMap.put("Yakutsk", "Asia/Yakutsk");
136
tempMap.put("Yakutsk Standard Time", "Asia/Yakutsk");
137
tempMap.put("Central European", "Europe/Belgrade");
138
tempMap.put("Central European Standard Time", "Europe/Belgrade");
139
tempMap.put("W. Europe", "Europe/Berlin");
140
tempMap.put("W. Europe Standard Time", "Europe/Berlin");
141
tempMap.put("Tasmania", "Australia/Hobart");
142
tempMap.put("Tasmania Standard Time", "Australia/Hobart");
143
tempMap.put("AUS Eastern", "Australia/Sydney");
144
tempMap.put("AUS Eastern Standard Time", "Australia/Sydney");
145
tempMap.put("E. Australia", "Australia/Brisbane");
146
tempMap.put("E. Australia Standard Time", "Australia/Brisbane");
147
tempMap.put("Sydney Standard Time", "Australia/Sydney");
148
tempMap.put("Central Pacific", "Pacific/Guadalcanal");
149
tempMap.put("Central Pacific Standard Time", "Pacific/Guadalcanal");
150
tempMap.put("Dateline", "Pacific/Majuro");
151
tempMap.put("Dateline Standard Time", "Pacific/Majuro");
152
tempMap.put("Fiji", "Pacific/Fiji");
153
tempMap.put("Fiji Standard Time", "Pacific/Fiji");
154
tempMap.put("Samoa", "Pacific/Apia");
155
tempMap.put("Samoa Standard Time", "Pacific/Apia");
156
tempMap.put("Hawaiian", "Pacific/Honolulu");
157
tempMap.put("Hawaiian Standard Time", "Pacific/Honolulu");
158
tempMap.put("Alaskan", "America/Anchorage");
159
tempMap.put("Alaskan Standard Time", "America/Anchorage");
160
tempMap.put("Pacific", "America/Los_Angeles");
161
tempMap.put("Pacific Standard Time", "America/Los_Angeles");
162
tempMap.put("Mexico Standard Time 2", "America/Chihuahua");
163
tempMap.put("Mountain", "America/Denver");
164
tempMap.put("Mountain Standard Time", "America/Denver");
165
tempMap.put("Central", "America/Chicago");
166
tempMap.put("Central Standard Time", "America/Chicago");
167
tempMap.put("Eastern", "America/New_York");
168
tempMap.put("Eastern Standard Time", "America/New_York");
169
tempMap.put("E. Europe", "Europe/Bucharest");
170
tempMap.put("E. Europe Standard Time", "Europe/Bucharest");
171
tempMap.put("Egypt", "Africa/Cairo");
172
tempMap.put("Egypt Standard Time", "Africa/Cairo");
173
tempMap.put("South Africa", "Africa/Harare");
174
tempMap.put("South Africa Standard Time", "Africa/Harare");
175
tempMap.put("Atlantic", "America/Halifax");
176
tempMap.put("Atlantic Standard Time", "America/Halifax");
177
tempMap.put("SA Eastern", "America/Buenos_Aires");
178
tempMap.put("SA Eastern Standard Time", "America/Buenos_Aires");
179
tempMap.put("Mid-Atlantic", "Atlantic/South_Georgia");
180
tempMap.put("Mid-Atlantic Standard Time", "Atlantic/South_Georgia");
181
tempMap.put("Azores", "Atlantic/Azores");
182
tempMap.put("Azores Standard Time", "Atlantic/Azores");
183
tempMap.put("Cape Verde Standard Time", "Atlantic/Cape_Verde");
184
tempMap.put("Russian", "Europe/Moscow");
185
tempMap.put("Russian Standard Time", "Europe/Moscow");
186
tempMap.put("New Zealand", "Pacific/Auckland");
187
tempMap.put("New Zealand Standard Time", "Pacific/Auckland");
188
tempMap.put("Tonga Standard Time", "Pacific/Tongatapu");
189
tempMap.put("Arabian", "Asia/Muscat");
190
tempMap.put("Arabian Standard Time", "Asia/Muscat");
191
tempMap.put("Caucasus", "Asia/Tbilisi");
192
tempMap.put("Caucasus Standard Time", "Asia/Tbilisi");
193
tempMap.put("GMT Standard Time", "GMT");
194
tempMap.put("Greenwich", "GMT");
195
tempMap.put("Greenwich Standard Time", "GMT");
196
tempMap.put("UTC", "GMT");
198
TIMEZONE_MAPPINGS = Collections.unmodifiableMap(tempMap);
201
// Handle abbreviated mappings
203
tempMap = new HashMap();
205
tempMap.put("ACST", new String[] { "America/Porto_Acre" });
206
tempMap.put("ACT", new String[] { "America/Porto_Acre" });
207
tempMap.put("ADDT", new String[] { "America/Pangnirtung" });
209
new String[] { "Africa/Asmera", "Africa/Addis_Ababa" });
212
"Atlantic/Bermuda", "Asia/Baghdad", "America/Thule",
213
"America/Goose_Bay", "America/Halifax", "America/Glace_Bay",
214
"America/Pangnirtung", "America/Barbados", "America/Martinique"
216
tempMap.put("AFT", new String[] { "Asia/Kabul" });
217
tempMap.put("AHDT", new String[] { "America/Anchorage" });
218
tempMap.put("AHST", new String[] { "America/Anchorage" });
219
tempMap.put("AHWT", new String[] { "America/Anchorage" });
222
"America/Juneau", "America/Yakutat", "America/Anchorage",
227
"Asia/Aqtobe", "America/Juneau", "America/Yakutat",
228
"America/Anchorage", "America/Nome"
230
tempMap.put("AKT", new String[] { "Asia/Aqtobe" });
231
tempMap.put("AKTST", new String[] { "Asia/Aqtobe" });
234
"America/Juneau", "America/Yakutat", "America/Anchorage",
237
tempMap.put("ALMST", new String[] { "Asia/Almaty" });
238
tempMap.put("ALMT", new String[] { "Asia/Almaty" });
241
"Asia/Yerevan", "America/Cuiaba", "America/Porto_Velho",
242
"America/Boa_Vista", "America/Manaus"
246
"Europe/Athens", "Europe/Amsterdam", "Asia/Yerevan",
247
"Africa/Asmera", "America/Cuiaba", "America/Porto_Velho",
248
"America/Boa_Vista", "America/Manaus", "America/Asuncion"
250
tempMap.put("ANAMT", new String[] { "Asia/Anadyr" });
251
tempMap.put("ANAST", new String[] { "Asia/Anadyr" });
252
tempMap.put("ANAT", new String[] { "Asia/Anadyr" });
253
tempMap.put("ANT", new String[] { "America/Aruba", "America/Curacao" });
254
tempMap.put("AQTST", new String[] { "Asia/Aqtobe", "Asia/Aqtau" });
255
tempMap.put("AQTT", new String[] { "Asia/Aqtobe", "Asia/Aqtau" });
258
"Antarctica/Palmer", "America/Buenos_Aires", "America/Rosario",
259
"America/Cordoba", "America/Jujuy", "America/Catamarca",
264
"Antarctica/Palmer", "America/Buenos_Aires", "America/Rosario",
265
"America/Cordoba", "America/Jujuy", "America/Catamarca",
268
tempMap.put("ASHST", new String[] { "Asia/Ashkhabad" });
269
tempMap.put("ASHT", new String[] { "Asia/Ashkhabad" });
272
"Atlantic/Bermuda", "Asia/Bahrain", "Asia/Baghdad",
273
"Asia/Kuwait", "Asia/Qatar", "Asia/Riyadh", "Asia/Aden",
274
"America/Thule", "America/Goose_Bay", "America/Halifax",
275
"America/Glace_Bay", "America/Pangnirtung", "America/Anguilla",
276
"America/Antigua", "America/Barbados", "America/Dominica",
277
"America/Santo_Domingo", "America/Grenada", "America/Guadeloupe",
278
"America/Martinique", "America/Montserrat",
279
"America/Puerto_Rico", "America/St_Kitts", "America/St_Lucia",
280
"America/Miquelon", "America/St_Vincent", "America/Tortola",
281
"America/St_Thomas", "America/Aruba", "America/Curacao",
282
"America/Port_of_Spain"
284
tempMap.put("AWT", new String[] { "America/Puerto_Rico" });
285
tempMap.put("AZOST", new String[] { "Atlantic/Azores" });
286
tempMap.put("AZOT", new String[] { "Atlantic/Azores" });
287
tempMap.put("AZST", new String[] { "Asia/Baku" });
288
tempMap.put("AZT", new String[] { "Asia/Baku" });
289
tempMap.put("BAKST", new String[] { "Asia/Baku" });
290
tempMap.put("BAKT", new String[] { "Asia/Baku" });
292
new String[] { "Asia/Dacca", "America/Nome", "America/Adak" });
294
new String[] { "Africa/Nairobi", "Africa/Mogadishu", "Africa/Kampala" });
297
"Africa/Nairobi", "Africa/Dar_es_Salaam", "Africa/Kampala"
301
"Europe/Brussels", "Europe/Chisinau", "Europe/Tiraspol",
302
"Europe/Bucharest", "Europe/Zurich", "Asia/Baghdad",
303
"Asia/Bangkok", "Africa/Banjul", "America/Barbados",
306
tempMap.put("BNT", new String[] { "Asia/Brunei" });
308
new String[] { "Asia/Ujung_Pandang", "Asia/Kuching" });
309
tempMap.put("BOST", new String[] { "America/La_Paz" });
310
tempMap.put("BOT", new String[] { "America/La_Paz" });
313
"America/Belem", "America/Fortaleza", "America/Araguaina",
314
"America/Maceio", "America/Sao_Paulo"
318
"America/Belem", "America/Fortaleza", "America/Araguaina",
319
"America/Maceio", "America/Sao_Paulo"
323
"Europe/London", "Europe/Belfast", "Europe/Dublin",
324
"Europe/Gibraltar", "Pacific/Pago_Pago", "Pacific/Midway",
325
"America/Nome", "America/Adak"
327
tempMap.put("BTT", new String[] { "Asia/Thimbu" });
329
new String[] { "Asia/Dacca", "Asia/Rangoon", "Asia/Calcutta" });
330
tempMap.put("BWT", new String[] { "America/Nome", "America/Adak" });
331
tempMap.put("CANT", new String[] { "Atlantic/Canary" });
333
new String[] { "Africa/Gaborone", "Africa/Khartoum" });
336
"Africa/Gaborone", "Africa/Bujumbura", "Africa/Lubumbashi",
337
"Africa/Blantyre", "Africa/Maputo", "Africa/Windhoek",
338
"Africa/Kigali", "Africa/Khartoum", "Africa/Lusaka",
339
"Africa/Harare", "America/Anchorage"
341
tempMap.put("CCT", new String[] { "Indian/Cocos" });
342
tempMap.put("CDDT", new String[] { "America/Rankin_Inlet" });
345
"Asia/Harbin", "Asia/Shanghai", "Asia/Chungking", "Asia/Urumqi",
346
"Asia/Kashgar", "Asia/Taipei", "Asia/Macao", "America/Chicago",
347
"America/Indianapolis", "America/Indiana/Marengo",
348
"America/Indiana/Knox", "America/Indiana/Vevay",
349
"America/Louisville", "America/Menominee", "America/Rainy_River",
350
"America/Winnipeg", "America/Pangnirtung", "America/Iqaluit",
351
"America/Rankin_Inlet", "America/Cambridge_Bay",
352
"America/Cancun", "America/Mexico_City", "America/Chihuahua",
353
"America/Belize", "America/Costa_Rica", "America/Havana",
354
"America/El_Salvador", "America/Guatemala",
355
"America/Tegucigalpa", "America/Managua"
359
"Europe/Tirane", "Europe/Andorra", "Europe/Vienna",
360
"Europe/Minsk", "Europe/Brussels", "Europe/Sofia",
361
"Europe/Prague", "Europe/Copenhagen", "Europe/Tallinn",
362
"Europe/Berlin", "Europe/Gibraltar", "Europe/Athens",
363
"Europe/Budapest", "Europe/Rome", "Europe/Riga", "Europe/Vaduz",
364
"Europe/Vilnius", "Europe/Luxembourg", "Europe/Malta",
365
"Europe/Chisinau", "Europe/Tiraspol", "Europe/Monaco",
366
"Europe/Amsterdam", "Europe/Oslo", "Europe/Warsaw",
367
"Europe/Lisbon", "Europe/Kaliningrad", "Europe/Madrid",
368
"Europe/Stockholm", "Europe/Zurich", "Europe/Kiev",
369
"Europe/Uzhgorod", "Europe/Zaporozhye", "Europe/Simferopol",
370
"Europe/Belgrade", "Africa/Algiers", "Africa/Tripoli",
371
"Africa/Tunis", "Africa/Ceuta"
375
"Europe/Tirane", "Europe/Andorra", "Europe/Vienna",
376
"Europe/Minsk", "Europe/Brussels", "Europe/Sofia",
377
"Europe/Prague", "Europe/Copenhagen", "Europe/Tallinn",
378
"Europe/Berlin", "Europe/Gibraltar", "Europe/Athens",
379
"Europe/Budapest", "Europe/Rome", "Europe/Riga", "Europe/Vaduz",
380
"Europe/Vilnius", "Europe/Luxembourg", "Europe/Malta",
381
"Europe/Chisinau", "Europe/Tiraspol", "Europe/Monaco",
382
"Europe/Amsterdam", "Europe/Oslo", "Europe/Warsaw",
383
"Europe/Lisbon", "Europe/Kaliningrad", "Europe/Madrid",
384
"Europe/Stockholm", "Europe/Zurich", "Europe/Kiev",
385
"Europe/Uzhgorod", "Europe/Zaporozhye", "Europe/Simferopol",
386
"Europe/Belgrade", "Africa/Algiers", "Africa/Tripoli",
387
"Africa/Casablanca", "Africa/Tunis", "Africa/Ceuta"
389
tempMap.put("CGST", new String[] { "America/Scoresbysund" });
390
tempMap.put("CGT", new String[] { "America/Scoresbysund" });
391
tempMap.put("CHDT", new String[] { "America/Belize" });
392
tempMap.put("CHUT", new String[] { "Asia/Chungking" });
393
tempMap.put("CJT", new String[] { "Asia/Tokyo" });
394
tempMap.put("CKHST", new String[] { "Pacific/Rarotonga" });
395
tempMap.put("CKT", new String[] { "Pacific/Rarotonga" });
397
new String[] { "Antarctica/Palmer", "America/Santiago" });
399
new String[] { "Antarctica/Palmer", "America/Santiago" });
402
"Europe/Copenhagen", "Europe/Chisinau", "Europe/Tiraspol",
403
"America/St_Lucia", "America/Buenos_Aires", "America/Rosario",
404
"America/Cordoba", "America/Jujuy", "America/Catamarca",
405
"America/Mendoza", "America/Caracas"
407
tempMap.put("COST", new String[] { "America/Bogota" });
408
tempMap.put("COT", new String[] { "America/Bogota" });
411
"Asia/Harbin", "Asia/Shanghai", "Asia/Chungking", "Asia/Urumqi",
412
"Asia/Kashgar", "Asia/Taipei", "Asia/Macao", "Asia/Jayapura",
413
"Australia/Darwin", "Australia/Adelaide",
414
"Australia/Broken_Hill", "America/Chicago",
415
"America/Indianapolis", "America/Indiana/Marengo",
416
"America/Indiana/Knox", "America/Indiana/Vevay",
417
"America/Louisville", "America/Detroit", "America/Menominee",
418
"America/Rainy_River", "America/Winnipeg", "America/Regina",
419
"America/Swift_Current", "America/Pangnirtung",
420
"America/Iqaluit", "America/Rankin_Inlet",
421
"America/Cambridge_Bay", "America/Cancun", "America/Mexico_City",
422
"America/Chihuahua", "America/Hermosillo", "America/Mazatlan",
423
"America/Belize", "America/Costa_Rica", "America/Havana",
424
"America/El_Salvador", "America/Guatemala",
425
"America/Tegucigalpa", "America/Managua"
427
tempMap.put("CUT", new String[] { "Europe/Zaporozhye" });
428
tempMap.put("CVST", new String[] { "Atlantic/Cape_Verde" });
429
tempMap.put("CVT", new String[] { "Atlantic/Cape_Verde" });
432
"America/Chicago", "America/Indianapolis",
433
"America/Indiana/Marengo", "America/Indiana/Knox",
434
"America/Indiana/Vevay", "America/Louisville",
437
tempMap.put("CXT", new String[] { "Indian/Christmas" });
438
tempMap.put("DACT", new String[] { "Asia/Dacca" });
439
tempMap.put("DAVT", new String[] { "Antarctica/Davis" });
440
tempMap.put("DDUT", new String[] { "Antarctica/DumontDUrville" });
441
tempMap.put("DFT", new String[] { "Europe/Oslo", "Europe/Paris" });
442
tempMap.put("DMT", new String[] { "Europe/Belfast", "Europe/Dublin" });
443
tempMap.put("DUSST", new String[] { "Asia/Dushanbe" });
444
tempMap.put("DUST", new String[] { "Asia/Dushanbe" });
445
tempMap.put("EASST", new String[] { "Pacific/Easter" });
447
new String[] { "Indian/Antananarivo", "Pacific/Easter" });
450
"Indian/Comoro", "Indian/Antananarivo", "Indian/Mayotte",
451
"Africa/Djibouti", "Africa/Asmera", "Africa/Addis_Ababa",
452
"Africa/Nairobi", "Africa/Mogadishu", "Africa/Khartoum",
453
"Africa/Dar_es_Salaam", "Africa/Kampala"
456
new String[] { "Pacific/Galapagos", "America/Guayaquil" });
457
tempMap.put("EDDT", new String[] { "America/Iqaluit" });
460
"America/New_York", "America/Indianapolis",
461
"America/Indiana/Marengo", "America/Indiana/Vevay",
462
"America/Louisville", "America/Detroit", "America/Montreal",
463
"America/Thunder_Bay", "America/Nipigon", "America/Pangnirtung",
464
"America/Iqaluit", "America/Cancun", "America/Nassau",
465
"America/Santo_Domingo", "America/Port-au-Prince",
466
"America/Jamaica", "America/Grand_Turk"
470
"Europe/Minsk", "Europe/Chisinau", "Europe/Tiraspol",
471
"Europe/Kaliningrad", "Europe/Moscow"
475
"Europe/Minsk", "Europe/Sofia", "Europe/Tallinn",
476
"Europe/Helsinki", "Europe/Athens", "Europe/Riga",
477
"Europe/Vilnius", "Europe/Chisinau", "Europe/Tiraspol",
478
"Europe/Warsaw", "Europe/Bucharest", "Europe/Kaliningrad",
479
"Europe/Moscow", "Europe/Istanbul", "Europe/Kiev",
480
"Europe/Uzhgorod", "Europe/Zaporozhye", "Asia/Nicosia",
481
"Asia/Amman", "Asia/Beirut", "Asia/Gaza", "Asia/Damascus",
486
"Europe/Minsk", "Europe/Sofia", "Europe/Tallinn",
487
"Europe/Helsinki", "Europe/Athens", "Europe/Riga",
488
"Europe/Vilnius", "Europe/Chisinau", "Europe/Tiraspol",
489
"Europe/Warsaw", "Europe/Bucharest", "Europe/Kaliningrad",
490
"Europe/Moscow", "Europe/Istanbul", "Europe/Kiev",
491
"Europe/Uzhgorod", "Europe/Zaporozhye", "Europe/Simferopol",
492
"Asia/Nicosia", "Asia/Amman", "Asia/Beirut", "Asia/Gaza",
493
"Asia/Damascus", "Africa/Cairo", "Africa/Tripoli"
495
tempMap.put("EGST", new String[] { "America/Scoresbysund" });
497
new String[] { "Atlantic/Jan_Mayen", "America/Scoresbysund" });
498
tempMap.put("EHDT", new String[] { "America/Santo_Domingo" });
501
"Australia/Brisbane", "Australia/Lindeman", "Australia/Hobart",
502
"Australia/Melbourne", "Australia/Sydney",
503
"Australia/Broken_Hill", "Australia/Lord_Howe",
504
"America/New_York", "America/Chicago", "America/Indianapolis",
505
"America/Indiana/Marengo", "America/Indiana/Knox",
506
"America/Indiana/Vevay", "America/Louisville", "America/Detroit",
507
"America/Menominee", "America/Montreal", "America/Thunder_Bay",
508
"America/Nipigon", "America/Pangnirtung", "America/Iqaluit",
509
"America/Cancun", "America/Antigua", "America/Nassau",
510
"America/Cayman", "America/Santo_Domingo",
511
"America/Port-au-Prince", "America/Jamaica", "America/Managua",
512
"America/Panama", "America/Grand_Turk"
516
"America/New_York", "America/Indianapolis",
517
"America/Indiana/Marengo", "America/Indiana/Vevay",
518
"America/Louisville", "America/Detroit", "America/Jamaica"
520
tempMap.put("FFMT", new String[] { "America/Martinique" });
521
tempMap.put("FJST", new String[] { "Pacific/Fiji" });
522
tempMap.put("FJT", new String[] { "Pacific/Fiji" });
523
tempMap.put("FKST", new String[] { "Atlantic/Stanley" });
524
tempMap.put("FKT", new String[] { "Atlantic/Stanley" });
526
new String[] { "Atlantic/Madeira", "Africa/Freetown" });
527
tempMap.put("FNST", new String[] { "America/Noronha" });
528
tempMap.put("FNT", new String[] { "America/Noronha" });
529
tempMap.put("FRUST", new String[] { "Asia/Bishkek" });
530
tempMap.put("FRUT", new String[] { "Asia/Bishkek" });
531
tempMap.put("GALT", new String[] { "Pacific/Galapagos" });
532
tempMap.put("GAMT", new String[] { "Pacific/Gambier" });
533
tempMap.put("GBGT", new String[] { "America/Guyana" });
534
tempMap.put("GEST", new String[] { "Asia/Tbilisi" });
535
tempMap.put("GET", new String[] { "Asia/Tbilisi" });
536
tempMap.put("GFT", new String[] { "America/Cayenne" });
537
tempMap.put("GHST", new String[] { "Africa/Accra" });
538
tempMap.put("GILT", new String[] { "Pacific/Tarawa" });
541
"Atlantic/St_Helena", "Atlantic/Reykjavik", "Europe/London",
542
"Europe/Belfast", "Europe/Dublin", "Europe/Gibraltar",
543
"Africa/Porto-Novo", "Africa/Ouagadougou", "Africa/Abidjan",
544
"Africa/Malabo", "Africa/Banjul", "Africa/Accra",
545
"Africa/Conakry", "Africa/Bissau", "Africa/Monrovia",
546
"Africa/Bamako", "Africa/Timbuktu", "Africa/Nouakchott",
547
"Africa/Niamey", "Africa/Sao_Tome", "Africa/Dakar",
548
"Africa/Freetown", "Africa/Lome"
552
"Atlantic/South_Georgia", "Asia/Bahrain", "Asia/Muscat",
553
"Asia/Qatar", "Asia/Dubai", "Pacific/Guam"
555
tempMap.put("GYT", new String[] { "America/Guyana" });
556
tempMap.put("HADT", new String[] { "America/Adak" });
557
tempMap.put("HART", new String[] { "Asia/Harbin" });
558
tempMap.put("HAST", new String[] { "America/Adak" });
559
tempMap.put("HAWT", new String[] { "America/Adak" });
560
tempMap.put("HDT", new String[] { "Pacific/Honolulu" });
561
tempMap.put("HKST", new String[] { "Asia/Hong_Kong" });
562
tempMap.put("HKT", new String[] { "Asia/Hong_Kong" });
565
"Atlantic/Azores", "Europe/Helsinki", "Asia/Dacca",
566
"Asia/Calcutta", "America/Havana"
568
tempMap.put("HOVST", new String[] { "Asia/Hovd" });
569
tempMap.put("HOVT", new String[] { "Asia/Hovd" });
571
new String[] { "Pacific/Johnston", "Pacific/Honolulu" });
572
tempMap.put("HWT", new String[] { "Pacific/Honolulu" });
575
"Asia/Phnom_Penh", "Asia/Vientiane", "Asia/Bangkok",
578
tempMap.put("IDDT", new String[] { "Asia/Jerusalem", "Asia/Gaza" });
579
tempMap.put("IDT", new String[] { "Asia/Jerusalem", "Asia/Gaza" });
580
tempMap.put("IHST", new String[] { "Asia/Colombo" });
582
new String[] { "Europe/Sofia", "Europe/Istanbul", "Asia/Irkutsk" });
583
tempMap.put("IOT", new String[] { "Indian/Chagos" });
584
tempMap.put("IRKMT", new String[] { "Asia/Irkutsk" });
585
tempMap.put("IRKST", new String[] { "Asia/Irkutsk" });
586
tempMap.put("IRKT", new String[] { "Asia/Irkutsk" });
587
tempMap.put("IRST", new String[] { "Asia/Tehran" });
588
tempMap.put("IRT", new String[] { "Asia/Tehran" });
589
tempMap.put("ISST", new String[] { "Atlantic/Reykjavik" });
592
"Atlantic/Reykjavik", "Europe/Belfast", "Europe/Dublin",
593
"Asia/Dacca", "Asia/Thimbu", "Asia/Calcutta", "Asia/Jerusalem",
594
"Asia/Katmandu", "Asia/Karachi", "Asia/Gaza", "Asia/Colombo"
596
tempMap.put("JAYT", new String[] { "Asia/Jayapura" });
598
new String[] { "Atlantic/St_Helena", "Asia/Jerusalem" });
601
"Asia/Rangoon", "Asia/Dili", "Asia/Ujung_Pandang", "Asia/Tokyo",
602
"Asia/Kuala_Lumpur", "Asia/Kuching", "Asia/Manila",
603
"Asia/Singapore", "Pacific/Nauru"
605
tempMap.put("KART", new String[] { "Asia/Karachi" });
606
tempMap.put("KAST", new String[] { "Asia/Kashgar" });
607
tempMap.put("KDT", new String[] { "Asia/Seoul" });
608
tempMap.put("KGST", new String[] { "Asia/Bishkek" });
609
tempMap.put("KGT", new String[] { "Asia/Bishkek" });
612
"Europe/Vilnius", "Europe/Kiev", "America/Cayman",
613
"America/Jamaica", "America/St_Vincent", "America/Grand_Turk"
615
tempMap.put("KOST", new String[] { "Pacific/Kosrae" });
616
tempMap.put("KRAMT", new String[] { "Asia/Krasnoyarsk" });
617
tempMap.put("KRAST", new String[] { "Asia/Krasnoyarsk" });
618
tempMap.put("KRAT", new String[] { "Asia/Krasnoyarsk" });
619
tempMap.put("KST", new String[] { "Asia/Seoul", "Asia/Pyongyang" });
620
tempMap.put("KUYMT", new String[] { "Europe/Samara" });
621
tempMap.put("KUYST", new String[] { "Europe/Samara" });
622
tempMap.put("KUYT", new String[] { "Europe/Samara" });
623
tempMap.put("KWAT", new String[] { "Pacific/Kwajalein" });
624
tempMap.put("LHST", new String[] { "Australia/Lord_Howe" });
625
tempMap.put("LINT", new String[] { "Pacific/Kiritimati" });
626
tempMap.put("LKT", new String[] { "Asia/Colombo" });
627
tempMap.put("LPMT", new String[] { "America/La_Paz" });
628
tempMap.put("LRT", new String[] { "Africa/Monrovia" });
629
tempMap.put("LST", new String[] { "Europe/Riga" });
630
tempMap.put("M", new String[] { "Europe/Moscow" });
631
tempMap.put("MADST", new String[] { "Atlantic/Madeira" });
632
tempMap.put("MAGMT", new String[] { "Asia/Magadan" });
633
tempMap.put("MAGST", new String[] { "Asia/Magadan" });
634
tempMap.put("MAGT", new String[] { "Asia/Magadan" });
636
new String[] { "Asia/Kuala_Lumpur", "Asia/Singapore" });
637
tempMap.put("MART", new String[] { "Pacific/Marquesas" });
638
tempMap.put("MAWT", new String[] { "Antarctica/Mawson" });
641
"America/Cambridge_Bay", "America/Yellowknife", "America/Inuvik"
643
tempMap.put("MDST", new String[] { "Europe/Moscow" });
646
"America/Denver", "America/Phoenix", "America/Boise",
647
"America/Regina", "America/Swift_Current", "America/Edmonton",
648
"America/Cambridge_Bay", "America/Yellowknife", "America/Inuvik",
649
"America/Chihuahua", "America/Hermosillo", "America/Mazatlan"
653
"Europe/Tirane", "Europe/Andorra", "Europe/Vienna",
654
"Europe/Minsk", "Europe/Brussels", "Europe/Sofia",
655
"Europe/Prague", "Europe/Copenhagen", "Europe/Tallinn",
656
"Europe/Berlin", "Europe/Gibraltar", "Europe/Athens",
657
"Europe/Budapest", "Europe/Rome", "Europe/Riga", "Europe/Vaduz",
658
"Europe/Vilnius", "Europe/Luxembourg", "Europe/Malta",
659
"Europe/Chisinau", "Europe/Tiraspol", "Europe/Monaco",
660
"Europe/Amsterdam", "Europe/Oslo", "Europe/Warsaw",
661
"Europe/Lisbon", "Europe/Kaliningrad", "Europe/Madrid",
662
"Europe/Stockholm", "Europe/Zurich", "Europe/Kiev",
663
"Europe/Uzhgorod", "Europe/Zaporozhye", "Europe/Simferopol",
664
"Europe/Belgrade", "Africa/Algiers", "Africa/Tripoli",
665
"Africa/Casablanca", "Africa/Tunis", "Africa/Ceuta"
668
new String[] { "Pacific/Majuro", "Pacific/Kwajalein" });
671
"Indian/Maldives", "Europe/Minsk", "Europe/Moscow",
672
"Asia/Rangoon", "Asia/Ujung_Pandang", "Asia/Colombo",
673
"Pacific/Easter", "Africa/Monrovia", "America/Managua",
676
tempMap.put("MOST", new String[] { "Asia/Macao" });
677
tempMap.put("MOT", new String[] { "Asia/Macao" });
678
tempMap.put("MPT", new String[] { "Pacific/Saipan" });
681
"Europe/Minsk", "Europe/Tallinn", "Europe/Riga",
682
"Europe/Vilnius", "Europe/Chisinau", "Europe/Kiev",
683
"Europe/Uzhgorod", "Europe/Zaporozhye", "Europe/Simferopol"
687
"Europe/Moscow", "America/Denver", "America/Phoenix",
688
"America/Boise", "America/Regina", "America/Swift_Current",
689
"America/Edmonton", "America/Dawson_Creek",
690
"America/Cambridge_Bay", "America/Yellowknife", "America/Inuvik",
691
"America/Mexico_City", "America/Chihuahua", "America/Hermosillo",
692
"America/Mazatlan", "America/Tijuana"
694
tempMap.put("MUT", new String[] { "Indian/Mauritius" });
695
tempMap.put("MVT", new String[] { "Indian/Maldives" });
697
new String[] { "America/Denver", "America/Phoenix", "America/Boise" });
698
tempMap.put("MYT", new String[] { "Asia/Kuala_Lumpur", "Asia/Kuching" });
699
tempMap.put("NCST", new String[] { "Pacific/Noumea" });
700
tempMap.put("NCT", new String[] { "Pacific/Noumea" });
703
"America/Nome", "America/Adak", "America/St_Johns",
706
tempMap.put("NEGT", new String[] { "America/Paramaribo" });
708
new String[] { "Europe/Paris", "Europe/Oslo", "Pacific/Norfolk" });
709
tempMap.put("NMT", new String[] { "Pacific/Norfolk" });
710
tempMap.put("NOVMT", new String[] { "Asia/Novosibirsk" });
711
tempMap.put("NOVST", new String[] { "Asia/Novosibirsk" });
712
tempMap.put("NOVT", new String[] { "Asia/Novosibirsk" });
713
tempMap.put("NPT", new String[] { "Asia/Katmandu" });
714
tempMap.put("NRT", new String[] { "Pacific/Nauru" });
717
"Europe/Amsterdam", "Pacific/Pago_Pago", "Pacific/Midway",
718
"America/Nome", "America/Adak", "America/St_Johns",
721
tempMap.put("NUT", new String[] { "Pacific/Niue" });
722
tempMap.put("NWT", new String[] { "America/Nome", "America/Adak" });
723
tempMap.put("NZDT", new String[] { "Antarctica/McMurdo" });
724
tempMap.put("NZHDT", new String[] { "Pacific/Auckland" });
726
new String[] { "Antarctica/McMurdo", "Pacific/Auckland" });
727
tempMap.put("OMSMT", new String[] { "Asia/Omsk" });
728
tempMap.put("OMSST", new String[] { "Asia/Omsk" });
729
tempMap.put("OMST", new String[] { "Asia/Omsk" });
732
"America/Inuvik", "America/Whitehorse", "America/Dawson"
736
"America/Los_Angeles", "America/Juneau", "America/Boise",
737
"America/Vancouver", "America/Dawson_Creek", "America/Inuvik",
738
"America/Whitehorse", "America/Dawson", "America/Tijuana"
740
tempMap.put("PEST", new String[] { "America/Lima" });
741
tempMap.put("PET", new String[] { "America/Lima" });
742
tempMap.put("PETMT", new String[] { "Asia/Kamchatka" });
743
tempMap.put("PETST", new String[] { "Asia/Kamchatka" });
744
tempMap.put("PETT", new String[] { "Asia/Kamchatka" });
745
tempMap.put("PGT", new String[] { "Pacific/Port_Moresby" });
746
tempMap.put("PHOT", new String[] { "Pacific/Enderbury" });
747
tempMap.put("PHST", new String[] { "Asia/Manila" });
748
tempMap.put("PHT", new String[] { "Asia/Manila" });
749
tempMap.put("PKT", new String[] { "Asia/Karachi" });
750
tempMap.put("PMDT", new String[] { "America/Miquelon" });
751
tempMap.put("PMMT", new String[] { "Pacific/Port_Moresby" });
752
tempMap.put("PMST", new String[] { "America/Miquelon" });
755
"Antarctica/DumontDUrville", "Europe/Prague", "Europe/Paris",
756
"Europe/Monaco", "Africa/Algiers", "Africa/Tunis",
757
"America/Panama", "America/Paramaribo"
759
tempMap.put("PNT", new String[] { "Pacific/Pitcairn" });
760
tempMap.put("PONT", new String[] { "Pacific/Ponape" });
761
tempMap.put("PPMT", new String[] { "America/Port-au-Prince" });
764
"Pacific/Pitcairn", "America/Los_Angeles", "America/Juneau",
765
"America/Boise", "America/Vancouver", "America/Dawson_Creek",
766
"America/Inuvik", "America/Whitehorse", "America/Dawson",
767
"America/Hermosillo", "America/Mazatlan", "America/Tijuana"
771
"Pacific/Palau", "America/Los_Angeles", "America/Juneau",
772
"America/Boise", "America/Tijuana"
774
tempMap.put("PYST", new String[] { "America/Asuncion" });
775
tempMap.put("PYT", new String[] { "America/Asuncion" });
776
tempMap.put("QMT", new String[] { "America/Guayaquil" });
777
tempMap.put("RET", new String[] { "Indian/Reunion" });
780
"Atlantic/Reykjavik", "Europe/Rome", "Europe/Riga",
783
tempMap.put("S", new String[] { "Europe/Moscow" });
784
tempMap.put("SAMMT", new String[] { "Europe/Samara" });
785
tempMap.put("SAMST", new String[] { "Europe/Samara", "Asia/Samarkand" });
788
"Europe/Samara", "Asia/Samarkand", "Pacific/Pago_Pago",
793
"Africa/Maseru", "Africa/Windhoek", "Africa/Johannesburg",
796
tempMap.put("SBT", new String[] { "Pacific/Guadalcanal" });
797
tempMap.put("SCT", new String[] { "Indian/Mahe" });
798
tempMap.put("SDMT", new String[] { "America/Santo_Domingo" });
799
tempMap.put("SGT", new String[] { "Asia/Singapore" });
800
tempMap.put("SHEST", new String[] { "Asia/Aqtau" });
801
tempMap.put("SHET", new String[] { "Asia/Aqtau" });
802
tempMap.put("SJMT", new String[] { "America/Costa_Rica" });
803
tempMap.put("SLST", new String[] { "Africa/Freetown" });
806
"Atlantic/Stanley", "Europe/Stockholm", "Europe/Simferopol",
807
"Asia/Phnom_Penh", "Asia/Vientiane", "Asia/Kuala_Lumpur",
808
"Asia/Singapore", "Asia/Saigon", "America/Santiago"
810
tempMap.put("SRT", new String[] { "America/Paramaribo" });
812
new String[] { "Pacific/Pago_Pago", "Pacific/Midway" });
813
tempMap.put("SVEMT", new String[] { "Asia/Yekaterinburg" });
814
tempMap.put("SVEST", new String[] { "Asia/Yekaterinburg" });
815
tempMap.put("SVET", new String[] { "Asia/Yekaterinburg" });
816
tempMap.put("SWAT", new String[] { "Africa/Windhoek" });
817
tempMap.put("SYOT", new String[] { "Antarctica/Syowa" });
818
tempMap.put("TAHT", new String[] { "Pacific/Tahiti" });
819
tempMap.put("TASST", new String[] { "Asia/Samarkand", "Asia/Tashkent" });
820
tempMap.put("TAST", new String[] { "Asia/Samarkand", "Asia/Tashkent" });
821
tempMap.put("TBIST", new String[] { "Asia/Tbilisi" });
822
tempMap.put("TBIT", new String[] { "Asia/Tbilisi" });
823
tempMap.put("TBMT", new String[] { "Asia/Tbilisi" });
824
tempMap.put("TFT", new String[] { "Indian/Kerguelen" });
825
tempMap.put("TJT", new String[] { "Asia/Dushanbe" });
826
tempMap.put("TKT", new String[] { "Pacific/Fakaofo" });
827
tempMap.put("TMST", new String[] { "Asia/Ashkhabad" });
829
new String[] { "Europe/Tallinn", "Asia/Tehran", "Asia/Ashkhabad" });
830
tempMap.put("TOST", new String[] { "Pacific/Tongatapu" });
831
tempMap.put("TOT", new String[] { "Pacific/Tongatapu" });
832
tempMap.put("TPT", new String[] { "Asia/Dili" });
833
tempMap.put("TRST", new String[] { "Europe/Istanbul" });
834
tempMap.put("TRT", new String[] { "Europe/Istanbul" });
835
tempMap.put("TRUT", new String[] { "Pacific/Truk" });
836
tempMap.put("TVT", new String[] { "Pacific/Funafuti" });
837
tempMap.put("ULAST", new String[] { "Asia/Ulaanbaatar" });
838
tempMap.put("ULAT", new String[] { "Asia/Ulaanbaatar" });
839
tempMap.put("URUT", new String[] { "Asia/Urumqi" });
840
tempMap.put("UYHST", new String[] { "America/Montevideo" });
841
tempMap.put("UYT", new String[] { "America/Montevideo" });
842
tempMap.put("UZST", new String[] { "Asia/Samarkand", "Asia/Tashkent" });
843
tempMap.put("UZT", new String[] { "Asia/Samarkand", "Asia/Tashkent" });
844
tempMap.put("VET", new String[] { "America/Caracas" });
845
tempMap.put("VLAMT", new String[] { "Asia/Vladivostok" });
846
tempMap.put("VLAST", new String[] { "Asia/Vladivostok" });
847
tempMap.put("VLAT", new String[] { "Asia/Vladivostok" });
848
tempMap.put("VUST", new String[] { "Pacific/Efate" });
849
tempMap.put("VUT", new String[] { "Pacific/Efate" });
850
tempMap.put("WAKT", new String[] { "Pacific/Wake" });
851
tempMap.put("WARST", new String[] { "America/Jujuy", "America/Mendoza" });
852
tempMap.put("WART", new String[] { "America/Jujuy", "America/Mendoza" });
854
new String[] { "Africa/Ndjamena", "Africa/Windhoek" });
857
"Africa/Luanda", "Africa/Porto-Novo", "Africa/Douala",
858
"Africa/Bangui", "Africa/Ndjamena", "Africa/Kinshasa",
859
"Africa/Brazzaville", "Africa/Malabo", "Africa/Libreville",
860
"Africa/Banjul", "Africa/Conakry", "Africa/Bissau",
861
"Africa/Bamako", "Africa/Nouakchott", "Africa/El_Aaiun",
862
"Africa/Windhoek", "Africa/Niamey", "Africa/Lagos",
863
"Africa/Dakar", "Africa/Freetown"
867
"Atlantic/Faeroe", "Atlantic/Azores", "Atlantic/Madeira",
868
"Atlantic/Canary", "Europe/Brussels", "Europe/Luxembourg",
869
"Europe/Monaco", "Europe/Lisbon", "Europe/Madrid",
870
"Africa/Algiers", "Africa/Casablanca", "Africa/Ceuta"
874
"Atlantic/Faeroe", "Atlantic/Azores", "Atlantic/Madeira",
875
"Atlantic/Canary", "Europe/Andorra", "Europe/Brussels",
876
"Europe/Luxembourg", "Europe/Monaco", "Europe/Lisbon",
877
"Europe/Madrid", "Africa/Algiers", "Africa/Casablanca",
878
"Africa/El_Aaiun", "Africa/Ceuta"
880
tempMap.put("WFT", new String[] { "Pacific/Wallis" });
881
tempMap.put("WGST", new String[] { "America/Godthab" });
882
tempMap.put("WGT", new String[] { "America/Godthab" });
883
tempMap.put("WMT", new String[] { "Europe/Vilnius", "Europe/Warsaw" });
885
new String[] { "Antarctica/Casey", "Pacific/Apia", "Australia/Perth" });
886
tempMap.put("YAKMT", new String[] { "Asia/Yakutsk" });
887
tempMap.put("YAKST", new String[] { "Asia/Yakutsk" });
888
tempMap.put("YAKT", new String[] { "Asia/Yakutsk" });
889
tempMap.put("YAPT", new String[] { "Pacific/Yap" });
891
new String[] { "America/Whitehorse", "America/Dawson" });
894
"America/Yakutat", "America/Whitehorse", "America/Dawson"
896
tempMap.put("YEKMT", new String[] { "Asia/Yekaterinburg" });
897
tempMap.put("YEKST", new String[] { "Asia/Yekaterinburg" });
898
tempMap.put("YEKT", new String[] { "Asia/Yekaterinburg" });
899
tempMap.put("YERST", new String[] { "Asia/Yerevan" });
900
tempMap.put("YERT", new String[] { "Asia/Yerevan" });
903
"America/Yakutat", "America/Whitehorse", "America/Dawson"
905
tempMap.put("YWT", new String[] { "America/Yakutat" });
907
ABBREVIATED_TIMEZONES = Collections.unmodifiableMap(tempMap);
911
* Returns the 'official' Java timezone name for the given timezone
913
* @param timezoneStr the 'common' timezone name
915
* @return the Java timezone name for the given timezone
917
public static String getCanoncialTimezone(String timezoneStr) {
918
if (timezoneStr == null) {
922
timezoneStr = timezoneStr.trim();
924
// Fix windows Daylight/Standard shift JDK doesn't map these (doh)
925
String timezoneStrUC = timezoneStr.toUpperCase();
926
int daylightIndex = timezoneStrUC.indexOf("DAYLIGHT");
928
if (daylightIndex != -1) {
929
StringBuffer timezoneBuf = new StringBuffer();
930
timezoneBuf.append(timezoneStr.substring(0, daylightIndex));
931
timezoneBuf.append("Standard");
932
timezoneBuf.append(timezoneStr.substring(daylightIndex
933
+ "DAYLIGHT".length(), timezoneStr.length()));
934
timezoneStr = timezoneBuf.toString();
937
String canonicalTz = (String) TIMEZONE_MAPPINGS.get(timezoneStr);
939
// if we didn't find it, try abbreviated timezones
940
if (canonicalTz == null) {
941
String[] abbreviatedTimezone = (String[]) ABBREVIATED_TIMEZONES.get(timezoneStr);
943
if (abbreviatedTimezone != null) {
944
// If there's only one mapping use that
945
if (abbreviatedTimezone.length == 1) {
946
canonicalTz = abbreviatedTimezone[0];
948
StringBuffer errorMsg = new StringBuffer(
949
"The server timezone value '");
950
errorMsg.append(timezoneStr);
952
"' represents more than one timezone. You must ");
954
"configure either the server or client to use a ");
956
"more specifc timezone value if you want to enable ");
957
errorMsg.append("timezone support. The timezones that '");
958
errorMsg.append(timezoneStr);
959
errorMsg.append("maps to are: ");
960
errorMsg.append(abbreviatedTimezone[0]);
962
for (int i = 1; i < abbreviatedTimezone.length; i++) {
963
errorMsg.append(", ");
964
errorMsg.append(abbreviatedTimezone[i]);
967
throw new IllegalArgumentException(errorMsg.toString());
976
* Change the given timestamp from one timezone to another
978
* @param conn the current connection to the MySQL server
979
* @param tstamp the timestamp to change
980
* @param fromTz the timezone to change from
981
* @param toTz the timezone to change to
983
* @return the timestamp changed to the timezone 'toTz'
985
public static Timestamp changeTimezone(Connection conn, Timestamp tstamp,
986
TimeZone fromTz, TimeZone toTz) {
987
if ((conn != null) && conn.useTimezone()) {
988
// Convert the timestamp from GMT to the server's timezone
989
Calendar fromCal = Calendar.getInstance(fromTz);
990
fromCal.setTime(tstamp);
992
int fromOffset = fromCal.get(Calendar.ZONE_OFFSET)
993
+ fromCal.get(Calendar.DST_OFFSET);
994
Calendar toCal = Calendar.getInstance(toTz);
995
toCal.setTime(tstamp);
997
int toOffset = toCal.get(Calendar.ZONE_OFFSET)
998
+ toCal.get(Calendar.DST_OFFSET);
999
int offsetDiff = toOffset - fromOffset;
1000
long toTime = toCal.getTime().getTime();
1001
toTime += offsetDiff;
1003
Timestamp changedTimestamp = new Timestamp(toTime);
1005
return changedTimestamp;
1012
* Change the given times from one timezone to another
1014
* @param conn the current connection to the MySQL server
1015
* @param t the times to change
1016
* @param fromTz the timezone to change from
1017
* @param toTz the timezone to change to
1019
* @return the times changed to the timezone 'toTz'
1021
public static Time changeTimezone(Connection conn, Time t, TimeZone fromTz,
1023
if ((conn != null) && conn.useTimezone()) {
1024
// Convert the timestamp from GMT to the server's timezone
1025
Calendar fromCal = Calendar.getInstance(fromTz);
1028
int fromOffset = fromCal.get(Calendar.ZONE_OFFSET)
1029
+ fromCal.get(Calendar.DST_OFFSET);
1030
Calendar toCal = Calendar.getInstance(toTz);
1033
int toOffset = toCal.get(Calendar.ZONE_OFFSET)
1034
+ toCal.get(Calendar.DST_OFFSET);
1035
int offsetDiff = toOffset - fromOffset;
1036
long toTime = toCal.getTime().getTime();
1037
toTime += offsetDiff;
1039
Time changedTime = new Time(toTime);