Created
March 26, 2015 02:03
-
-
Save scottmac/655675e9b4d4913c539c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from urllib2 import urlopen | |
import xml.etree.ElementTree as ET | |
from collections import OrderedDict | |
alias_uri = 'http://www.unicode.org/repos/cldr/trunk/common/bcp47/timezone.xml' | |
alias_root = ET.parse(urlopen(alias_uri)).getroot() | |
olsonAliases = {} | |
for node in alias_root.findall("./keyword/key[@alias='timezone']/type"): | |
olsonNames = node.get('alias', '').split(' ') | |
if len(olsonNames) > 1: | |
olsonAliases[olsonNames[0]] = olsonNames[1:] | |
windows_uri = 'http://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml' | |
windows_root = ET.parse(urlopen(windows_uri)).getroot() | |
versions = windows_root.find('./windowsZones/mapTimezones') | |
win2olson = {} | |
olson2win = {} | |
for node in windows_root.findall('./windowsZones/mapTimezones/mapZone'): | |
olsonNames = node.get('type', '').split(' ') | |
windowsName = node.get('other', '') | |
for olsonName in olsonNames: | |
if olsonName not in olson2win: | |
olson2win[olsonName] = windowsName | |
if olsonName in olsonAliases: | |
for alias in olsonAliases[olsonName]: | |
olson2win[alias] = windowsName | |
if windowsName not in win2olson: | |
win2olson[windowsName] = olsonNames[0] | |
print '''// Auto-generated by scripts/build_tz.py | |
// Data fetched from %s | |
// Versions windows: %s olson: %s''' % (windows_uri, versions.get('otherVersion'), versions.get('typeVersion')) | |
print ''' | |
namespace Timezone.Helpers { | |
public static class TzTranslate { | |
public static string olson2win(string name) { | |
switch(name) {''' | |
for k, v in OrderedDict(sorted(olson2win.items())).iteritems(): | |
print ' case "%s": return "%s";' % (k, v) | |
print ''' default: return null; | |
} | |
} | |
public static string win2olson(string name) { | |
switch(name) {''' | |
for k, v in OrderedDict(sorted(win2olson.items())).iteritems(): | |
print ' case "%s": return "%s";' % (k, v) | |
print ''' default: return null; | |
} | |
} | |
} | |
}''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Auto-generated by scripts/build_tz.py | |
// Data fetched from http://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml | |
// Versions windows: 7df0004 olson: 2015a | |
namespace Timezone.Helpers { | |
public static class TzTranslate { | |
public static string olson2win(string name) { | |
switch(name) { | |
case "Africa/Abidjan": return "Greenwich Standard Time"; | |
case "Africa/Accra": return "Greenwich Standard Time"; | |
case "Africa/Addis_Ababa": return "E. Africa Standard Time"; | |
case "Africa/Algiers": return "W. Central Africa Standard Time"; | |
case "Africa/Asmara": return "E. Africa Standard Time"; | |
case "Africa/Asmera": return "E. Africa Standard Time"; | |
case "Africa/Bamako": return "Greenwich Standard Time"; | |
case "Africa/Bangui": return "W. Central Africa Standard Time"; | |
case "Africa/Banjul": return "Greenwich Standard Time"; | |
case "Africa/Bissau": return "Greenwich Standard Time"; | |
case "Africa/Blantyre": return "South Africa Standard Time"; | |
case "Africa/Brazzaville": return "W. Central Africa Standard Time"; | |
case "Africa/Bujumbura": return "South Africa Standard Time"; | |
case "Africa/Cairo": return "Egypt Standard Time"; | |
case "Africa/Casablanca": return "Morocco Standard Time"; | |
case "Africa/Ceuta": return "Romance Standard Time"; | |
case "Africa/Conakry": return "Greenwich Standard Time"; | |
case "Africa/Dakar": return "Greenwich Standard Time"; | |
case "Africa/Dar_es_Salaam": return "E. Africa Standard Time"; | |
case "Africa/Djibouti": return "E. Africa Standard Time"; | |
case "Africa/Douala": return "W. Central Africa Standard Time"; | |
case "Africa/El_Aaiun": return "Morocco Standard Time"; | |
case "Africa/Freetown": return "Greenwich Standard Time"; | |
case "Africa/Gaborone": return "South Africa Standard Time"; | |
case "Africa/Harare": return "South Africa Standard Time"; | |
case "Africa/Johannesburg": return "South Africa Standard Time"; | |
case "Africa/Juba": return "E. Africa Standard Time"; | |
case "Africa/Kampala": return "E. Africa Standard Time"; | |
case "Africa/Khartoum": return "E. Africa Standard Time"; | |
case "Africa/Kigali": return "South Africa Standard Time"; | |
case "Africa/Kinshasa": return "W. Central Africa Standard Time"; | |
case "Africa/Lagos": return "W. Central Africa Standard Time"; | |
case "Africa/Libreville": return "W. Central Africa Standard Time"; | |
case "Africa/Lome": return "Greenwich Standard Time"; | |
case "Africa/Luanda": return "W. Central Africa Standard Time"; | |
case "Africa/Lubumbashi": return "South Africa Standard Time"; | |
case "Africa/Lusaka": return "South Africa Standard Time"; | |
case "Africa/Malabo": return "W. Central Africa Standard Time"; | |
case "Africa/Maputo": return "South Africa Standard Time"; | |
case "Africa/Maseru": return "South Africa Standard Time"; | |
case "Africa/Mbabane": return "South Africa Standard Time"; | |
case "Africa/Mogadishu": return "E. Africa Standard Time"; | |
case "Africa/Monrovia": return "Greenwich Standard Time"; | |
case "Africa/Nairobi": return "E. Africa Standard Time"; | |
case "Africa/Ndjamena": return "W. Central Africa Standard Time"; | |
case "Africa/Niamey": return "W. Central Africa Standard Time"; | |
case "Africa/Nouakchott": return "Greenwich Standard Time"; | |
case "Africa/Ouagadougou": return "Greenwich Standard Time"; | |
case "Africa/Porto-Novo": return "W. Central Africa Standard Time"; | |
case "Africa/Sao_Tome": return "Greenwich Standard Time"; | |
case "Africa/Timbuktu": return "Greenwich Standard Time"; | |
case "Africa/Tripoli": return "Libya Standard Time"; | |
case "Africa/Tunis": return "W. Central Africa Standard Time"; | |
case "Africa/Windhoek": return "Namibia Standard Time"; | |
case "America/Anchorage": return "Alaskan Standard Time"; | |
case "America/Anguilla": return "SA Western Standard Time"; | |
case "America/Antigua": return "SA Western Standard Time"; | |
case "America/Araguaina": return "SA Eastern Standard Time"; | |
case "America/Argentina/Buenos_Aires": return "Argentina Standard Time"; | |
case "America/Argentina/Catamarca": return "Argentina Standard Time"; | |
case "America/Argentina/ComodRivadavia": return "Argentina Standard Time"; | |
case "America/Argentina/Cordoba": return "Argentina Standard Time"; | |
case "America/Argentina/Jujuy": return "Argentina Standard Time"; | |
case "America/Argentina/La_Rioja": return "Argentina Standard Time"; | |
case "America/Argentina/Mendoza": return "Argentina Standard Time"; | |
case "America/Argentina/Rio_Gallegos": return "Argentina Standard Time"; | |
case "America/Argentina/Salta": return "Argentina Standard Time"; | |
case "America/Argentina/San_Juan": return "Argentina Standard Time"; | |
case "America/Argentina/San_Luis": return "Argentina Standard Time"; | |
case "America/Argentina/Tucuman": return "Argentina Standard Time"; | |
case "America/Argentina/Ushuaia": return "Argentina Standard Time"; | |
case "America/Aruba": return "SA Western Standard Time"; | |
case "America/Asuncion": return "Paraguay Standard Time"; | |
case "America/Atikokan": return "SA Pacific Standard Time"; | |
case "America/Bahia": return "Bahia Standard Time"; | |
case "America/Bahia_Banderas": return "Central Standard Time (Mexico)"; | |
case "America/Barbados": return "SA Western Standard Time"; | |
case "America/Belem": return "SA Eastern Standard Time"; | |
case "America/Belize": return "Central America Standard Time"; | |
case "America/Blanc-Sablon": return "SA Western Standard Time"; | |
case "America/Boa_Vista": return "SA Western Standard Time"; | |
case "America/Bogota": return "SA Pacific Standard Time"; | |
case "America/Boise": return "Mountain Standard Time"; | |
case "America/Buenos_Aires": return "Argentina Standard Time"; | |
case "America/Cambridge_Bay": return "Mountain Standard Time"; | |
case "America/Campo_Grande": return "Central Brazilian Standard Time"; | |
case "America/Cancun": return "Eastern Standard Time (Mexico)"; | |
case "America/Caracas": return "Venezuela Standard Time"; | |
case "America/Catamarca": return "Argentina Standard Time"; | |
case "America/Cayenne": return "SA Eastern Standard Time"; | |
case "America/Cayman": return "SA Pacific Standard Time"; | |
case "America/Chicago": return "Central Standard Time"; | |
case "America/Chihuahua": return "Mountain Standard Time (Mexico)"; | |
case "America/Coral_Harbour": return "SA Pacific Standard Time"; | |
case "America/Cordoba": return "Argentina Standard Time"; | |
case "America/Costa_Rica": return "Central America Standard Time"; | |
case "America/Creston": return "US Mountain Standard Time"; | |
case "America/Cuiaba": return "Central Brazilian Standard Time"; | |
case "America/Curacao": return "SA Western Standard Time"; | |
case "America/Danmarkshavn": return "UTC"; | |
case "America/Dawson": return "Pacific Standard Time"; | |
case "America/Dawson_Creek": return "US Mountain Standard Time"; | |
case "America/Denver": return "Mountain Standard Time"; | |
case "America/Detroit": return "Eastern Standard Time"; | |
case "America/Dominica": return "SA Western Standard Time"; | |
case "America/Edmonton": return "Mountain Standard Time"; | |
case "America/Eirunepe": return "SA Pacific Standard Time"; | |
case "America/El_Salvador": return "Central America Standard Time"; | |
case "America/Ensenada": return "Pacific Standard Time"; | |
case "America/Fort_Wayne": return "US Eastern Standard Time"; | |
case "America/Fortaleza": return "SA Eastern Standard Time"; | |
case "America/Glace_Bay": return "Atlantic Standard Time"; | |
case "America/Godthab": return "Greenland Standard Time"; | |
case "America/Goose_Bay": return "Atlantic Standard Time"; | |
case "America/Grand_Turk": return "SA Western Standard Time"; | |
case "America/Grenada": return "SA Western Standard Time"; | |
case "America/Guadeloupe": return "SA Western Standard Time"; | |
case "America/Guatemala": return "Central America Standard Time"; | |
case "America/Guayaquil": return "SA Pacific Standard Time"; | |
case "America/Guyana": return "SA Western Standard Time"; | |
case "America/Halifax": return "Atlantic Standard Time"; | |
case "America/Havana": return "Eastern Standard Time"; | |
case "America/Hermosillo": return "US Mountain Standard Time"; | |
case "America/Indiana/Indianapolis": return "US Eastern Standard Time"; | |
case "America/Indiana/Knox": return "Central Standard Time"; | |
case "America/Indiana/Marengo": return "US Eastern Standard Time"; | |
case "America/Indiana/Petersburg": return "Eastern Standard Time"; | |
case "America/Indiana/Tell_City": return "Central Standard Time"; | |
case "America/Indiana/Vevay": return "US Eastern Standard Time"; | |
case "America/Indiana/Vincennes": return "Eastern Standard Time"; | |
case "America/Indiana/Winamac": return "Eastern Standard Time"; | |
case "America/Indianapolis": return "US Eastern Standard Time"; | |
case "America/Inuvik": return "Mountain Standard Time"; | |
case "America/Iqaluit": return "Eastern Standard Time"; | |
case "America/Jamaica": return "SA Pacific Standard Time"; | |
case "America/Jujuy": return "Argentina Standard Time"; | |
case "America/Juneau": return "Alaskan Standard Time"; | |
case "America/Kentucky/Louisville": return "Eastern Standard Time"; | |
case "America/Kentucky/Monticello": return "Eastern Standard Time"; | |
case "America/Knox_IN": return "Central Standard Time"; | |
case "America/Kralendijk": return "SA Western Standard Time"; | |
case "America/La_Paz": return "SA Western Standard Time"; | |
case "America/Lima": return "SA Pacific Standard Time"; | |
case "America/Los_Angeles": return "Pacific Standard Time"; | |
case "America/Louisville": return "Eastern Standard Time"; | |
case "America/Lower_Princes": return "SA Western Standard Time"; | |
case "America/Maceio": return "SA Eastern Standard Time"; | |
case "America/Managua": return "Central America Standard Time"; | |
case "America/Manaus": return "SA Western Standard Time"; | |
case "America/Marigot": return "SA Western Standard Time"; | |
case "America/Martinique": return "SA Western Standard Time"; | |
case "America/Matamoros": return "Central Standard Time"; | |
case "America/Mazatlan": return "Mountain Standard Time (Mexico)"; | |
case "America/Mendoza": return "Argentina Standard Time"; | |
case "America/Menominee": return "Central Standard Time"; | |
case "America/Merida": return "Central Standard Time (Mexico)"; | |
case "America/Mexico_City": return "Central Standard Time (Mexico)"; | |
case "America/Moncton": return "Atlantic Standard Time"; | |
case "America/Monterrey": return "Central Standard Time (Mexico)"; | |
case "America/Montevideo": return "Montevideo Standard Time"; | |
case "America/Montreal": return "Eastern Standard Time"; | |
case "America/Montserrat": return "SA Western Standard Time"; | |
case "America/Nassau": return "Eastern Standard Time"; | |
case "America/New_York": return "Eastern Standard Time"; | |
case "America/Nipigon": return "Eastern Standard Time"; | |
case "America/Nome": return "Alaskan Standard Time"; | |
case "America/Noronha": return "UTC-02"; | |
case "America/North_Dakota/Beulah": return "Central Standard Time"; | |
case "America/North_Dakota/Center": return "Central Standard Time"; | |
case "America/North_Dakota/New_Salem": return "Central Standard Time"; | |
case "America/Ojinaga": return "Mountain Standard Time"; | |
case "America/Panama": return "SA Pacific Standard Time"; | |
case "America/Pangnirtung": return "Eastern Standard Time"; | |
case "America/Paramaribo": return "SA Eastern Standard Time"; | |
case "America/Phoenix": return "US Mountain Standard Time"; | |
case "America/Port-au-Prince": return "Eastern Standard Time"; | |
case "America/Port_of_Spain": return "SA Western Standard Time"; | |
case "America/Porto_Acre": return "SA Pacific Standard Time"; | |
case "America/Porto_Velho": return "SA Western Standard Time"; | |
case "America/Puerto_Rico": return "SA Western Standard Time"; | |
case "America/Rainy_River": return "Central Standard Time"; | |
case "America/Rankin_Inlet": return "Central Standard Time"; | |
case "America/Recife": return "SA Eastern Standard Time"; | |
case "America/Regina": return "Canada Central Standard Time"; | |
case "America/Resolute": return "Central Standard Time"; | |
case "America/Rio_Branco": return "SA Pacific Standard Time"; | |
case "America/Rosario": return "Argentina Standard Time"; | |
case "America/Santa_Isabel": return "Pacific Standard Time (Mexico)"; | |
case "America/Santarem": return "SA Eastern Standard Time"; | |
case "America/Santiago": return "Pacific SA Standard Time"; | |
case "America/Santo_Domingo": return "SA Western Standard Time"; | |
case "America/Sao_Paulo": return "E. South America Standard Time"; | |
case "America/Scoresbysund": return "Azores Standard Time"; | |
case "America/Shiprock": return "Mountain Standard Time"; | |
case "America/Sitka": return "Alaskan Standard Time"; | |
case "America/St_Barthelemy": return "SA Western Standard Time"; | |
case "America/St_Johns": return "Newfoundland Standard Time"; | |
case "America/St_Kitts": return "SA Western Standard Time"; | |
case "America/St_Lucia": return "SA Western Standard Time"; | |
case "America/St_Thomas": return "SA Western Standard Time"; | |
case "America/St_Vincent": return "SA Western Standard Time"; | |
case "America/Swift_Current": return "Canada Central Standard Time"; | |
case "America/Tegucigalpa": return "Central America Standard Time"; | |
case "America/Thule": return "Atlantic Standard Time"; | |
case "America/Thunder_Bay": return "Eastern Standard Time"; | |
case "America/Tijuana": return "Pacific Standard Time"; | |
case "America/Toronto": return "Eastern Standard Time"; | |
case "America/Tortola": return "SA Western Standard Time"; | |
case "America/Vancouver": return "Pacific Standard Time"; | |
case "America/Virgin": return "SA Western Standard Time"; | |
case "America/Whitehorse": return "Pacific Standard Time"; | |
case "America/Winnipeg": return "Central Standard Time"; | |
case "America/Yakutat": return "Alaskan Standard Time"; | |
case "America/Yellowknife": return "Mountain Standard Time"; | |
case "Antarctica/Casey": return "W. Australia Standard Time"; | |
case "Antarctica/Davis": return "SE Asia Standard Time"; | |
case "Antarctica/DumontDUrville": return "West Pacific Standard Time"; | |
case "Antarctica/Macquarie": return "Central Pacific Standard Time"; | |
case "Antarctica/Mawson": return "West Asia Standard Time"; | |
case "Antarctica/McMurdo": return "New Zealand Standard Time"; | |
case "Antarctica/Palmer": return "Pacific SA Standard Time"; | |
case "Antarctica/Rothera": return "SA Eastern Standard Time"; | |
case "Antarctica/South_Pole": return "New Zealand Standard Time"; | |
case "Antarctica/Syowa": return "E. Africa Standard Time"; | |
case "Antarctica/Vostok": return "Central Asia Standard Time"; | |
case "Arctic/Longyearbyen": return "W. Europe Standard Time"; | |
case "Asia/Aden": return "Arab Standard Time"; | |
case "Asia/Almaty": return "Central Asia Standard Time"; | |
case "Asia/Amman": return "Jordan Standard Time"; | |
case "Asia/Anadyr": return "Russia Time Zone 11"; | |
case "Asia/Aqtau": return "West Asia Standard Time"; | |
case "Asia/Aqtobe": return "West Asia Standard Time"; | |
case "Asia/Ashgabat": return "West Asia Standard Time"; | |
case "Asia/Ashkhabad": return "West Asia Standard Time"; | |
case "Asia/Baghdad": return "Arabic Standard Time"; | |
case "Asia/Bahrain": return "Arab Standard Time"; | |
case "Asia/Baku": return "Azerbaijan Standard Time"; | |
case "Asia/Bangkok": return "SE Asia Standard Time"; | |
case "Asia/Beirut": return "Middle East Standard Time"; | |
case "Asia/Bishkek": return "Central Asia Standard Time"; | |
case "Asia/Brunei": return "Singapore Standard Time"; | |
case "Asia/Calcutta": return "India Standard Time"; | |
case "Asia/Chita": return "North Asia East Standard Time"; | |
case "Asia/Choibalsan": return "Ulaanbaatar Standard Time"; | |
case "Asia/Chongqing": return "China Standard Time"; | |
case "Asia/Chungking": return "China Standard Time"; | |
case "Asia/Colombo": return "Sri Lanka Standard Time"; | |
case "Asia/Dacca": return "Bangladesh Standard Time"; | |
case "Asia/Damascus": return "Syria Standard Time"; | |
case "Asia/Dhaka": return "Bangladesh Standard Time"; | |
case "Asia/Dili": return "Tokyo Standard Time"; | |
case "Asia/Dubai": return "Arabian Standard Time"; | |
case "Asia/Dushanbe": return "West Asia Standard Time"; | |
case "Asia/Harbin": return "China Standard Time"; | |
case "Asia/Ho_Chi_Minh": return "SE Asia Standard Time"; | |
case "Asia/Hong_Kong": return "China Standard Time"; | |
case "Asia/Hovd": return "SE Asia Standard Time"; | |
case "Asia/Irkutsk": return "North Asia East Standard Time"; | |
case "Asia/Istanbul": return "Turkey Standard Time"; | |
case "Asia/Jakarta": return "SE Asia Standard Time"; | |
case "Asia/Jayapura": return "Tokyo Standard Time"; | |
case "Asia/Jerusalem": return "Israel Standard Time"; | |
case "Asia/Kabul": return "Afghanistan Standard Time"; | |
case "Asia/Kamchatka": return "Russia Time Zone 11"; | |
case "Asia/Karachi": return "Pakistan Standard Time"; | |
case "Asia/Kashgar": return "Central Asia Standard Time"; | |
case "Asia/Kathmandu": return "Nepal Standard Time"; | |
case "Asia/Katmandu": return "Nepal Standard Time"; | |
case "Asia/Khandyga": return "Yakutsk Standard Time"; | |
case "Asia/Kolkata": return "India Standard Time"; | |
case "Asia/Krasnoyarsk": return "North Asia Standard Time"; | |
case "Asia/Kuala_Lumpur": return "Singapore Standard Time"; | |
case "Asia/Kuching": return "Singapore Standard Time"; | |
case "Asia/Kuwait": return "Arab Standard Time"; | |
case "Asia/Macao": return "China Standard Time"; | |
case "Asia/Macau": return "China Standard Time"; | |
case "Asia/Magadan": return "Magadan Standard Time"; | |
case "Asia/Makassar": return "Singapore Standard Time"; | |
case "Asia/Manila": return "Singapore Standard Time"; | |
case "Asia/Muscat": return "Arabian Standard Time"; | |
case "Asia/Nicosia": return "GTB Standard Time"; | |
case "Asia/Novokuznetsk": return "North Asia Standard Time"; | |
case "Asia/Novosibirsk": return "N. Central Asia Standard Time"; | |
case "Asia/Omsk": return "N. Central Asia Standard Time"; | |
case "Asia/Oral": return "West Asia Standard Time"; | |
case "Asia/Phnom_Penh": return "SE Asia Standard Time"; | |
case "Asia/Pontianak": return "SE Asia Standard Time"; | |
case "Asia/Pyongyang": return "Korea Standard Time"; | |
case "Asia/Qatar": return "Arab Standard Time"; | |
case "Asia/Qyzylorda": return "Central Asia Standard Time"; | |
case "Asia/Rangoon": return "Myanmar Standard Time"; | |
case "Asia/Riyadh": return "Arab Standard Time"; | |
case "Asia/Saigon": return "SE Asia Standard Time"; | |
case "Asia/Sakhalin": return "Vladivostok Standard Time"; | |
case "Asia/Samarkand": return "West Asia Standard Time"; | |
case "Asia/Seoul": return "Korea Standard Time"; | |
case "Asia/Shanghai": return "China Standard Time"; | |
case "Asia/Singapore": return "Singapore Standard Time"; | |
case "Asia/Srednekolymsk": return "Russia Time Zone 10"; | |
case "Asia/Taipei": return "Taipei Standard Time"; | |
case "Asia/Tashkent": return "West Asia Standard Time"; | |
case "Asia/Tbilisi": return "Georgian Standard Time"; | |
case "Asia/Tehran": return "Iran Standard Time"; | |
case "Asia/Tel_Aviv": return "Israel Standard Time"; | |
case "Asia/Thimbu": return "Bangladesh Standard Time"; | |
case "Asia/Thimphu": return "Bangladesh Standard Time"; | |
case "Asia/Tokyo": return "Tokyo Standard Time"; | |
case "Asia/Ujung_Pandang": return "Singapore Standard Time"; | |
case "Asia/Ulaanbaatar": return "Ulaanbaatar Standard Time"; | |
case "Asia/Ulan_Bator": return "Ulaanbaatar Standard Time"; | |
case "Asia/Urumqi": return "Central Asia Standard Time"; | |
case "Asia/Ust-Nera": return "Vladivostok Standard Time"; | |
case "Asia/Vientiane": return "SE Asia Standard Time"; | |
case "Asia/Vladivostok": return "Vladivostok Standard Time"; | |
case "Asia/Yakutsk": return "Yakutsk Standard Time"; | |
case "Asia/Yekaterinburg": return "Ekaterinburg Standard Time"; | |
case "Asia/Yerevan": return "Caucasus Standard Time"; | |
case "Atlantic/Azores": return "Azores Standard Time"; | |
case "Atlantic/Bermuda": return "Atlantic Standard Time"; | |
case "Atlantic/Canary": return "GMT Standard Time"; | |
case "Atlantic/Cape_Verde": return "Cape Verde Standard Time"; | |
case "Atlantic/Faeroe": return "GMT Standard Time"; | |
case "Atlantic/Faroe": return "GMT Standard Time"; | |
case "Atlantic/Jan_Mayen": return "W. Europe Standard Time"; | |
case "Atlantic/Madeira": return "GMT Standard Time"; | |
case "Atlantic/Reykjavik": return "Greenwich Standard Time"; | |
case "Atlantic/South_Georgia": return "UTC-02"; | |
case "Atlantic/St_Helena": return "Greenwich Standard Time"; | |
case "Atlantic/Stanley": return "SA Eastern Standard Time"; | |
case "Australia/ACT": return "AUS Eastern Standard Time"; | |
case "Australia/Adelaide": return "Cen. Australia Standard Time"; | |
case "Australia/Brisbane": return "E. Australia Standard Time"; | |
case "Australia/Broken_Hill": return "Cen. Australia Standard Time"; | |
case "Australia/Canberra": return "AUS Eastern Standard Time"; | |
case "Australia/Currie": return "Tasmania Standard Time"; | |
case "Australia/Darwin": return "AUS Central Standard Time"; | |
case "Australia/Hobart": return "Tasmania Standard Time"; | |
case "Australia/Lindeman": return "E. Australia Standard Time"; | |
case "Australia/Melbourne": return "AUS Eastern Standard Time"; | |
case "Australia/NSW": return "AUS Eastern Standard Time"; | |
case "Australia/North": return "AUS Central Standard Time"; | |
case "Australia/Perth": return "W. Australia Standard Time"; | |
case "Australia/Queensland": return "E. Australia Standard Time"; | |
case "Australia/South": return "Cen. Australia Standard Time"; | |
case "Australia/Sydney": return "AUS Eastern Standard Time"; | |
case "Australia/Tasmania": return "Tasmania Standard Time"; | |
case "Australia/Victoria": return "AUS Eastern Standard Time"; | |
case "Australia/West": return "W. Australia Standard Time"; | |
case "Australia/Yancowinna": return "Cen. Australia Standard Time"; | |
case "Brazil/Acre": return "SA Pacific Standard Time"; | |
case "Brazil/DeNoronha": return "UTC-02"; | |
case "Brazil/East": return "E. South America Standard Time"; | |
case "Brazil/West": return "SA Western Standard Time"; | |
case "CST6CDT": return "Central Standard Time"; | |
case "Canada/Atlantic": return "Atlantic Standard Time"; | |
case "Canada/Central": return "Central Standard Time"; | |
case "Canada/East-Saskatchewan": return "Canada Central Standard Time"; | |
case "Canada/Eastern": return "Eastern Standard Time"; | |
case "Canada/Mountain": return "Mountain Standard Time"; | |
case "Canada/Newfoundland": return "Newfoundland Standard Time"; | |
case "Canada/Pacific": return "Pacific Standard Time"; | |
case "Canada/Saskatchewan": return "Canada Central Standard Time"; | |
case "Canada/Yukon": return "Pacific Standard Time"; | |
case "Chile/Continental": return "Pacific SA Standard Time"; | |
case "Cuba": return "Eastern Standard Time"; | |
case "EST": return "SA Pacific Standard Time"; | |
case "EST5EDT": return "Eastern Standard Time"; | |
case "Egypt": return "Egypt Standard Time"; | |
case "Eire": return "GMT Standard Time"; | |
case "Etc/GMT": return "UTC"; | |
case "Etc/GMT+0": return "UTC"; | |
case "Etc/GMT+1": return "Cape Verde Standard Time"; | |
case "Etc/GMT+10": return "Hawaiian Standard Time"; | |
case "Etc/GMT+11": return "UTC-11"; | |
case "Etc/GMT+12": return "Dateline Standard Time"; | |
case "Etc/GMT+2": return "UTC-02"; | |
case "Etc/GMT+3": return "SA Eastern Standard Time"; | |
case "Etc/GMT+4": return "SA Western Standard Time"; | |
case "Etc/GMT+5": return "SA Pacific Standard Time"; | |
case "Etc/GMT+6": return "Central America Standard Time"; | |
case "Etc/GMT+7": return "US Mountain Standard Time"; | |
case "Etc/GMT-0": return "UTC"; | |
case "Etc/GMT-1": return "W. Central Africa Standard Time"; | |
case "Etc/GMT-10": return "West Pacific Standard Time"; | |
case "Etc/GMT-11": return "Central Pacific Standard Time"; | |
case "Etc/GMT-12": return "UTC+12"; | |
case "Etc/GMT-13": return "Tonga Standard Time"; | |
case "Etc/GMT-14": return "Line Islands Standard Time"; | |
case "Etc/GMT-2": return "South Africa Standard Time"; | |
case "Etc/GMT-3": return "E. Africa Standard Time"; | |
case "Etc/GMT-4": return "Arabian Standard Time"; | |
case "Etc/GMT-5": return "West Asia Standard Time"; | |
case "Etc/GMT-6": return "Central Asia Standard Time"; | |
case "Etc/GMT-7": return "SE Asia Standard Time"; | |
case "Etc/GMT-8": return "Singapore Standard Time"; | |
case "Etc/GMT-9": return "Tokyo Standard Time"; | |
case "Etc/GMT0": return "UTC"; | |
case "Etc/Greenwich": return "UTC"; | |
case "Etc/UCT": return "UTC"; | |
case "Etc/UTC": return "UTC"; | |
case "Etc/Universal": return "UTC"; | |
case "Etc/Zulu": return "UTC"; | |
case "Europe/Amsterdam": return "W. Europe Standard Time"; | |
case "Europe/Andorra": return "W. Europe Standard Time"; | |
case "Europe/Athens": return "GTB Standard Time"; | |
case "Europe/Belfast": return "GMT Standard Time"; | |
case "Europe/Belgrade": return "Central Europe Standard Time"; | |
case "Europe/Berlin": return "W. Europe Standard Time"; | |
case "Europe/Bratislava": return "Central Europe Standard Time"; | |
case "Europe/Brussels": return "Romance Standard Time"; | |
case "Europe/Bucharest": return "GTB Standard Time"; | |
case "Europe/Budapest": return "Central Europe Standard Time"; | |
case "Europe/Busingen": return "W. Europe Standard Time"; | |
case "Europe/Chisinau": return "GTB Standard Time"; | |
case "Europe/Copenhagen": return "Romance Standard Time"; | |
case "Europe/Dublin": return "GMT Standard Time"; | |
case "Europe/Gibraltar": return "W. Europe Standard Time"; | |
case "Europe/Guernsey": return "GMT Standard Time"; | |
case "Europe/Helsinki": return "FLE Standard Time"; | |
case "Europe/Isle_of_Man": return "GMT Standard Time"; | |
case "Europe/Istanbul": return "Turkey Standard Time"; | |
case "Europe/Jersey": return "GMT Standard Time"; | |
case "Europe/Kaliningrad": return "Kaliningrad Standard Time"; | |
case "Europe/Kiev": return "FLE Standard Time"; | |
case "Europe/Lisbon": return "GMT Standard Time"; | |
case "Europe/Ljubljana": return "Central Europe Standard Time"; | |
case "Europe/London": return "GMT Standard Time"; | |
case "Europe/Luxembourg": return "W. Europe Standard Time"; | |
case "Europe/Madrid": return "Romance Standard Time"; | |
case "Europe/Malta": return "W. Europe Standard Time"; | |
case "Europe/Mariehamn": return "FLE Standard Time"; | |
case "Europe/Minsk": return "Belarus Standard Time"; | |
case "Europe/Monaco": return "W. Europe Standard Time"; | |
case "Europe/Moscow": return "Russian Standard Time"; | |
case "Europe/Nicosia": return "GTB Standard Time"; | |
case "Europe/Oslo": return "W. Europe Standard Time"; | |
case "Europe/Paris": return "Romance Standard Time"; | |
case "Europe/Podgorica": return "Central Europe Standard Time"; | |
case "Europe/Prague": return "Central Europe Standard Time"; | |
case "Europe/Riga": return "FLE Standard Time"; | |
case "Europe/Rome": return "W. Europe Standard Time"; | |
case "Europe/Samara": return "Russia Time Zone 3"; | |
case "Europe/San_Marino": return "W. Europe Standard Time"; | |
case "Europe/Sarajevo": return "Central European Standard Time"; | |
case "Europe/Simferopol": return "Russian Standard Time"; | |
case "Europe/Skopje": return "Central European Standard Time"; | |
case "Europe/Sofia": return "FLE Standard Time"; | |
case "Europe/Stockholm": return "W. Europe Standard Time"; | |
case "Europe/Tallinn": return "FLE Standard Time"; | |
case "Europe/Tirane": return "Central Europe Standard Time"; | |
case "Europe/Tiraspol": return "GTB Standard Time"; | |
case "Europe/Uzhgorod": return "FLE Standard Time"; | |
case "Europe/Vaduz": return "W. Europe Standard Time"; | |
case "Europe/Vatican": return "W. Europe Standard Time"; | |
case "Europe/Vienna": return "W. Europe Standard Time"; | |
case "Europe/Vilnius": return "FLE Standard Time"; | |
case "Europe/Volgograd": return "Russian Standard Time"; | |
case "Europe/Warsaw": return "Central European Standard Time"; | |
case "Europe/Zagreb": return "Central European Standard Time"; | |
case "Europe/Zaporozhye": return "FLE Standard Time"; | |
case "Europe/Zurich": return "W. Europe Standard Time"; | |
case "GB": return "GMT Standard Time"; | |
case "GB-Eire": return "GMT Standard Time"; | |
case "GMT": return "UTC"; | |
case "GMT+0": return "UTC"; | |
case "GMT-0": return "UTC"; | |
case "GMT0": return "UTC"; | |
case "Greenwich": return "UTC"; | |
case "HST": return "Hawaiian Standard Time"; | |
case "Hongkong": return "China Standard Time"; | |
case "Iceland": return "Greenwich Standard Time"; | |
case "Indian/Antananarivo": return "E. Africa Standard Time"; | |
case "Indian/Chagos": return "Central Asia Standard Time"; | |
case "Indian/Christmas": return "SE Asia Standard Time"; | |
case "Indian/Cocos": return "Myanmar Standard Time"; | |
case "Indian/Comoro": return "E. Africa Standard Time"; | |
case "Indian/Kerguelen": return "West Asia Standard Time"; | |
case "Indian/Mahe": return "Mauritius Standard Time"; | |
case "Indian/Maldives": return "West Asia Standard Time"; | |
case "Indian/Mauritius": return "Mauritius Standard Time"; | |
case "Indian/Mayotte": return "E. Africa Standard Time"; | |
case "Indian/Reunion": return "Mauritius Standard Time"; | |
case "Iran": return "Iran Standard Time"; | |
case "Israel": return "Israel Standard Time"; | |
case "Jamaica": return "SA Pacific Standard Time"; | |
case "Japan": return "Tokyo Standard Time"; | |
case "Kwajalein": return "UTC+12"; | |
case "Libya": return "Libya Standard Time"; | |
case "MST": return "US Mountain Standard Time"; | |
case "MST7MDT": return "Mountain Standard Time"; | |
case "Mexico/BajaNorte": return "Pacific Standard Time"; | |
case "Mexico/BajaSur": return "Mountain Standard Time (Mexico)"; | |
case "Mexico/General": return "Central Standard Time (Mexico)"; | |
case "NZ": return "New Zealand Standard Time"; | |
case "Navajo": return "Mountain Standard Time"; | |
case "PRC": return "China Standard Time"; | |
case "PST8PDT": return "Pacific Standard Time"; | |
case "Pacific/Apia": return "Samoa Standard Time"; | |
case "Pacific/Auckland": return "New Zealand Standard Time"; | |
case "Pacific/Bougainville": return "Central Pacific Standard Time"; | |
case "Pacific/Chuuk": return "West Pacific Standard Time"; | |
case "Pacific/Efate": return "Central Pacific Standard Time"; | |
case "Pacific/Enderbury": return "Tonga Standard Time"; | |
case "Pacific/Fakaofo": return "Tonga Standard Time"; | |
case "Pacific/Fiji": return "Fiji Standard Time"; | |
case "Pacific/Funafuti": return "UTC+12"; | |
case "Pacific/Galapagos": return "Central America Standard Time"; | |
case "Pacific/Guadalcanal": return "Central Pacific Standard Time"; | |
case "Pacific/Guam": return "West Pacific Standard Time"; | |
case "Pacific/Honolulu": return "Hawaiian Standard Time"; | |
case "Pacific/Johnston": return "Hawaiian Standard Time"; | |
case "Pacific/Kiritimati": return "Line Islands Standard Time"; | |
case "Pacific/Kosrae": return "Central Pacific Standard Time"; | |
case "Pacific/Kwajalein": return "UTC+12"; | |
case "Pacific/Majuro": return "UTC+12"; | |
case "Pacific/Midway": return "UTC-11"; | |
case "Pacific/Nauru": return "UTC+12"; | |
case "Pacific/Niue": return "UTC-11"; | |
case "Pacific/Noumea": return "Central Pacific Standard Time"; | |
case "Pacific/Pago_Pago": return "UTC-11"; | |
case "Pacific/Palau": return "Tokyo Standard Time"; | |
case "Pacific/Pohnpei": return "Central Pacific Standard Time"; | |
case "Pacific/Ponape": return "Central Pacific Standard Time"; | |
case "Pacific/Port_Moresby": return "West Pacific Standard Time"; | |
case "Pacific/Rarotonga": return "Hawaiian Standard Time"; | |
case "Pacific/Saipan": return "West Pacific Standard Time"; | |
case "Pacific/Samoa": return "UTC-11"; | |
case "Pacific/Tahiti": return "Hawaiian Standard Time"; | |
case "Pacific/Tarawa": return "UTC+12"; | |
case "Pacific/Tongatapu": return "Tonga Standard Time"; | |
case "Pacific/Truk": return "West Pacific Standard Time"; | |
case "Pacific/Wake": return "UTC+12"; | |
case "Pacific/Wallis": return "UTC+12"; | |
case "Pacific/Yap": return "West Pacific Standard Time"; | |
case "Poland": return "Central European Standard Time"; | |
case "Portugal": return "GMT Standard Time"; | |
case "ROC": return "Taipei Standard Time"; | |
case "ROK": return "Korea Standard Time"; | |
case "Singapore": return "Singapore Standard Time"; | |
case "Turkey": return "Turkey Standard Time"; | |
case "UCT": return "UTC"; | |
case "US/Alaska": return "Alaskan Standard Time"; | |
case "US/Arizona": return "US Mountain Standard Time"; | |
case "US/Central": return "Central Standard Time"; | |
case "US/East-Indiana": return "US Eastern Standard Time"; | |
case "US/Eastern": return "Eastern Standard Time"; | |
case "US/Hawaii": return "Hawaiian Standard Time"; | |
case "US/Indiana-Starke": return "Central Standard Time"; | |
case "US/Michigan": return "Eastern Standard Time"; | |
case "US/Mountain": return "Mountain Standard Time"; | |
case "US/Pacific": return "Pacific Standard Time"; | |
case "US/Pacific-New": return "Pacific Standard Time"; | |
case "US/Samoa": return "UTC-11"; | |
case "UTC": return "UTC"; | |
case "Universal": return "UTC"; | |
case "W-SU": return "Russian Standard Time"; | |
case "Zulu": return "UTC"; | |
default: return null; | |
} | |
} | |
public static string win2olson(string name) { | |
switch(name) { | |
case "AUS Central Standard Time": return "Australia/Darwin"; | |
case "AUS Eastern Standard Time": return "Australia/Sydney"; | |
case "Afghanistan Standard Time": return "Asia/Kabul"; | |
case "Alaskan Standard Time": return "America/Anchorage"; | |
case "Arab Standard Time": return "Asia/Riyadh"; | |
case "Arabian Standard Time": return "Asia/Dubai"; | |
case "Arabic Standard Time": return "Asia/Baghdad"; | |
case "Argentina Standard Time": return "America/Buenos_Aires"; | |
case "Atlantic Standard Time": return "America/Halifax"; | |
case "Azerbaijan Standard Time": return "Asia/Baku"; | |
case "Azores Standard Time": return "Atlantic/Azores"; | |
case "Bahia Standard Time": return "America/Bahia"; | |
case "Bangladesh Standard Time": return "Asia/Dhaka"; | |
case "Belarus Standard Time": return "Europe/Minsk"; | |
case "Canada Central Standard Time": return "America/Regina"; | |
case "Cape Verde Standard Time": return "Atlantic/Cape_Verde"; | |
case "Caucasus Standard Time": return "Asia/Yerevan"; | |
case "Cen. Australia Standard Time": return "Australia/Adelaide"; | |
case "Central America Standard Time": return "America/Guatemala"; | |
case "Central Asia Standard Time": return "Asia/Almaty"; | |
case "Central Brazilian Standard Time": return "America/Cuiaba"; | |
case "Central Europe Standard Time": return "Europe/Budapest"; | |
case "Central European Standard Time": return "Europe/Warsaw"; | |
case "Central Pacific Standard Time": return "Pacific/Guadalcanal"; | |
case "Central Standard Time": return "America/Chicago"; | |
case "Central Standard Time (Mexico)": return "America/Mexico_City"; | |
case "China Standard Time": return "Asia/Shanghai"; | |
case "Dateline Standard Time": return "Etc/GMT+12"; | |
case "E. Africa Standard Time": return "Africa/Nairobi"; | |
case "E. Australia Standard Time": return "Australia/Brisbane"; | |
case "E. South America Standard Time": return "America/Sao_Paulo"; | |
case "Eastern Standard Time": return "America/New_York"; | |
case "Eastern Standard Time (Mexico)": return "America/Cancun"; | |
case "Egypt Standard Time": return "Africa/Cairo"; | |
case "Ekaterinburg Standard Time": return "Asia/Yekaterinburg"; | |
case "FLE Standard Time": return "Europe/Kiev"; | |
case "Fiji Standard Time": return "Pacific/Fiji"; | |
case "GMT Standard Time": return "Europe/London"; | |
case "GTB Standard Time": return "Europe/Bucharest"; | |
case "Georgian Standard Time": return "Asia/Tbilisi"; | |
case "Greenland Standard Time": return "America/Godthab"; | |
case "Greenwich Standard Time": return "Atlantic/Reykjavik"; | |
case "Hawaiian Standard Time": return "Pacific/Honolulu"; | |
case "India Standard Time": return "Asia/Calcutta"; | |
case "Iran Standard Time": return "Asia/Tehran"; | |
case "Israel Standard Time": return "Asia/Jerusalem"; | |
case "Jordan Standard Time": return "Asia/Amman"; | |
case "Kaliningrad Standard Time": return "Europe/Kaliningrad"; | |
case "Korea Standard Time": return "Asia/Seoul"; | |
case "Libya Standard Time": return "Africa/Tripoli"; | |
case "Line Islands Standard Time": return "Pacific/Kiritimati"; | |
case "Magadan Standard Time": return "Asia/Magadan"; | |
case "Mauritius Standard Time": return "Indian/Mauritius"; | |
case "Middle East Standard Time": return "Asia/Beirut"; | |
case "Montevideo Standard Time": return "America/Montevideo"; | |
case "Morocco Standard Time": return "Africa/Casablanca"; | |
case "Mountain Standard Time": return "America/Denver"; | |
case "Mountain Standard Time (Mexico)": return "America/Chihuahua"; | |
case "Myanmar Standard Time": return "Asia/Rangoon"; | |
case "N. Central Asia Standard Time": return "Asia/Novosibirsk"; | |
case "Namibia Standard Time": return "Africa/Windhoek"; | |
case "Nepal Standard Time": return "Asia/Katmandu"; | |
case "New Zealand Standard Time": return "Pacific/Auckland"; | |
case "Newfoundland Standard Time": return "America/St_Johns"; | |
case "North Asia East Standard Time": return "Asia/Irkutsk"; | |
case "North Asia Standard Time": return "Asia/Krasnoyarsk"; | |
case "Pacific SA Standard Time": return "America/Santiago"; | |
case "Pacific Standard Time": return "America/Los_Angeles"; | |
case "Pacific Standard Time (Mexico)": return "America/Santa_Isabel"; | |
case "Pakistan Standard Time": return "Asia/Karachi"; | |
case "Paraguay Standard Time": return "America/Asuncion"; | |
case "Romance Standard Time": return "Europe/Paris"; | |
case "Russia Time Zone 10": return "Asia/Srednekolymsk"; | |
case "Russia Time Zone 11": return "Asia/Kamchatka"; | |
case "Russia Time Zone 3": return "Europe/Samara"; | |
case "Russian Standard Time": return "Europe/Moscow"; | |
case "SA Eastern Standard Time": return "America/Cayenne"; | |
case "SA Pacific Standard Time": return "America/Bogota"; | |
case "SA Western Standard Time": return "America/La_Paz"; | |
case "SE Asia Standard Time": return "Asia/Bangkok"; | |
case "Samoa Standard Time": return "Pacific/Apia"; | |
case "Singapore Standard Time": return "Asia/Singapore"; | |
case "South Africa Standard Time": return "Africa/Johannesburg"; | |
case "Sri Lanka Standard Time": return "Asia/Colombo"; | |
case "Syria Standard Time": return "Asia/Damascus"; | |
case "Taipei Standard Time": return "Asia/Taipei"; | |
case "Tasmania Standard Time": return "Australia/Hobart"; | |
case "Tokyo Standard Time": return "Asia/Tokyo"; | |
case "Tonga Standard Time": return "Pacific/Tongatapu"; | |
case "Turkey Standard Time": return "Europe/Istanbul"; | |
case "US Eastern Standard Time": return "America/Indianapolis"; | |
case "US Mountain Standard Time": return "America/Phoenix"; | |
case "UTC": return "Etc/GMT"; | |
case "UTC+12": return "Etc/GMT-12"; | |
case "UTC-02": return "Etc/GMT+2"; | |
case "UTC-11": return "Etc/GMT+11"; | |
case "Ulaanbaatar Standard Time": return "Asia/Ulaanbaatar"; | |
case "Venezuela Standard Time": return "America/Caracas"; | |
case "Vladivostok Standard Time": return "Asia/Vladivostok"; | |
case "W. Australia Standard Time": return "Australia/Perth"; | |
case "W. Central Africa Standard Time": return "Africa/Lagos"; | |
case "W. Europe Standard Time": return "Europe/Berlin"; | |
case "West Asia Standard Time": return "Asia/Tashkent"; | |
case "West Pacific Standard Time": return "Pacific/Port_Moresby"; | |
case "Yakutsk Standard Time": return "Asia/Yakutsk"; | |
default: return null; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment