Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Data
- # time zones grouped by country
- # [ [ "country", [ "time", "zones", "here" ] ], [ "country", [ "time", "zones", "here" ] ] ]
- timezones = [
- [
- "africa",
- [ "abidjan", "accra", "addis_ababa", "algiers", "asmera", "bamako", "bangui", "banjul", "bissau", "blantyre",
- "brazzaville", "bujumbura", "cairo", "casablanca", "ceuta", "conakry", "dakar", "dar_es_salaam", "djibouti",
- "douala", "el_aaiun", "freetown", "gaborone", "harare", "johannesburg", "kampala", "khartoum", "kigali",
- "kinshasa", "lagos", "libreville", "lome", "luanda", "lubumbashi", "lusaka", "malabo", "maputo", "maseru",
- "mbabane", "mogadishu", "monrovia", "nairobi", "ndjamena", "niamey", "nouakchott", "ouagadougou", "porto",
- "sao_tome", "tripoli", "tunis", "windhoek" ]
- ],
- [
- "america",
- [ "adak", "anchorage", "anguilla", "antigua", "araguaina", "argentina", "buenos_aires", "catamarca", "cordoba",
- "jujuy", "la_rioja", "mendoza", "rio_gallegos", "san_juan", "tucuman", "ushuaia", "aruba", "asuncion", "bahia",
- "barbados", "belem", "belize", "boa_vista", "bogota", "boise", "cambridge_bay", "campo_grande", "cancun",
- "caracas", "cayenne", "cayman", "chicago", "chihuahua", "coral_harbour", "costa_rica", "cuiaba", "curacao",
- "danmarkshavn", "dawson", "dawson_creek", "denver", "detroit", "dominica", "edmonton", "eirunepe", "el_salvador",
- "fortaleza", "glace_bay", "godthab", "goose_bay", "grand_turk", "grenada", "guadeloupe", "guatemala",
- "guayaquil", "guyana", "halifax", "havana", "hermosillo", "indiana", "indianapolis", "knox", "marengo",
- "petersburg", "vevay", "vincennes", "inuvik", "iqaluit", "jamaica", "juneau", "kentucky", "louisville",
- "monticello", "la_paz", "lima", "los_angeles", "maceio", "managua", "manaus", "martinique", "mazatlan",
- "menominee", "merida", "mexico_city", "miquelon", "moncton", "monterrey", "montevideo", "montreal", "montserrat",
- "nassau", "new_york", "nipigon", "nome", "noronha", "north_dakota", "center", "panama", "pangnirtung",
- "paramaribo", "phoenix", "port", "port_of_spain", "porto_velho", "puerto_rico", "rainy_river", "rankin_inlet",
- "recife", "regina", "rio_branco", "santiago", "santo_domingo", "sao_paulo", "scoresbysund", "shiprock",
- "st_johns", "st_kitts", "st_lucia", "st_thomas", "st_vincent", "swift_current", "tegucigalpa", "thule",
- "thunder_bay", "tijuana", "toronto", "tortola", "vancouver", "whitehorse", "winnipeg", "yakutat", "yellowknife"]
- ],
- [
- "antarctica",
- [ "casey", "davis", "dumont_d_urville", "mawson", "mc_murdo", "palmer", "rothera", "south_pole", "syowa", "vostok" ]
- ],
- [
- "arctic",
- [ "longyearbyen" ]
- ],
- [
- "asia",
- [ "aden", "almaty", "amman", "anadyr", "aqtau", "aqtobe", "ashgabat", "baghdad", "bahrain", "baku", "bangkok",
- "beirut", "bishkek", "brunei", "calcutta", "choibalsan", "chongqing", "colombo", "damascus", "dhaka", "dili",
- "dubai", "dushanbe", "gaza", "harbin", "hong_kong", "hovd", "irkutsk", "jakarta", "jayapura", "jerusalem",
- "kabul", "kamchatka", "karachi", "kashgar", "katmandu", "krasnoyarsk", "kuala_lumpur", "kuching", "kuwait",
- "macau", "magadan", "makassar", "manila", "muscat", "nicosia", "novosibirsk", "omsk", "oral", "phnom_penh",
- "pontianak", "pyongyang", "qatar", "qyzylorda", "rangoon", "riyadh", "saigon", "sakhalin", "samarkand", "seoul",
- "shanghai", "singapore", "taipei", "tashkent", "tbilisi", "tehran", "thimphu", "tokyo", "ulaanbaatar", "urumqi",
- "vientiane", "vladivostok", "yakutsk", "yekaterinburg", "yerevan" ]
- ],
- [
- "atlantic",
- [ "azores", "bermuda", "canary", "cape_verde", "faeroe", "jan_mayen", "madeira", "reykjavik", "south_georgia",
- "st_helena", "stanley" ]
- ],
- [
- "australia",
- [ "adelaide", "brisbane", "broken_hill", "currie", "darwin", "hobart", "lindeman", "lord_howe", "melbourne",
- "perth", "sydney" ]
- ],
- [
- "europe",
- [ "amsterdam", "andorra", "athens", "belgrade", "berlin", "bratislava", "brussels", "bucharest", "budapest",
- "chisinau", "copenhagen", "dublin", "gibraltar", "helsinki", "istanbul", "kaliningrad", "kiev", "lisbon",
- "ljubljana", "london", "luxembourg", "madrid", "malta", "mariehamn", "minsk", "monaco", "moscow", "oslo",
- "paris", "prague", "riga", "rome", "samara", "san_marino", "sarajevo", "simferopol", "skopje", "sofia",
- "stockholm", "tallinn", "tirane", "uzhgorod", "vaduz", "vatican", "vienna", "vilnius", "warsaw", "zagreb",
- "zaporozhye", "zurich" ]
- ],
- [
- "indian",
- [ "antananarivo", "chagos", "christmas", "cocos", "comoro", "kerguelen", "mahe", "maldives", "mauritius",
- "mayotte", "reunion"]
- ],
- [
- "pacific",
- [ "apia", "auckland", "chatham", "easter", "efate", "enderbury", "fakaofo", "fiji", "funafuti", "galapagos",
- "gambier", "guadalcanal", "guam", "honolulu", "johnston", "kiritimati", "kosrae", "kwajalein", "majuro",
- "marquesas", "midway", "nauru", "niue", "norfolk", "noumea", "pago_pago", "palau", "pitcairn", "ponape",
- "port_moresby", "rarotonga", "saipan", "tahiti", "tarawa", "tongatapu", "truk", "wake", "wallis" ]
- ]
- ]
- ## Normalization
- # i need this: [ [ "pasific/apia", "pasific/apia" ], [ "pasific/auckland", "pasific/auckland" ] ]
- timezones.map do |t|
- t[1].map do |x|
- [ t[0], x ]
- end
- end.flatten(1).map do |y|
- [ y.join("/"), y.join("/") ]
- end
Add Comment
Please, Sign In to add comment