Guest User

Untitled

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