-
-
Save jpmckinney/767070 to your computer and use it in GitHub Desktop.
# blog post: http://blog.slashpoundbang.com/post/2613268281/changing-from-tz-database-identifiers-to-rails-friendly | |
{ | |
"Australia/Adelaide" => "Adelaide", | |
"Australia/Broken_Hill" => "Adelaide", | |
"America/Anchorage" => "Alaska", | |
"America/Juneau" => "Alaska", | |
"America/Nome" => "Alaska", | |
"America/Yakutat" => "Alaska", | |
"Pacific/Gambier" => "Alaska", | |
"Asia/Almaty" => "Almaty", | |
"Europe/Amsterdam" => "Amsterdam", | |
"Europe/Athens" => "Athens", | |
"America/Anguilla" => "Atlantic Time (Canada)", | |
"America/Antigua" => "Atlantic Time (Canada)", | |
"America/Argentina/San_Luis" => "Atlantic Time (Canada)", | |
"America/Aruba" => "Atlantic Time (Canada)", | |
"America/Asuncion" => "Atlantic Time (Canada)", | |
"America/Barbados" => "Atlantic Time (Canada)", | |
"America/Blanc-Sablon" => "Atlantic Time (Canada)", | |
"America/Boa_Vista" => "Atlantic Time (Canada)", | |
"America/Campo_Grande" => "Atlantic Time (Canada)", | |
"America/Cuiaba" => "Atlantic Time (Canada)", | |
"America/Curacao" => "Atlantic Time (Canada)", | |
"America/Dominica" => "Atlantic Time (Canada)", | |
"America/Eirunepe" => "Atlantic Time (Canada)", | |
"America/Glace_Bay" => "Atlantic Time (Canada)", | |
"America/Goose_Bay" => "Atlantic Time (Canada)", | |
"America/Grenada" => "Atlantic Time (Canada)", | |
"America/Guadeloupe" => "Atlantic Time (Canada)", | |
"America/Guyana" => "Atlantic Time (Canada)", | |
"America/Halifax" => "Atlantic Time (Canada)", | |
"America/Manaus" => "Atlantic Time (Canada)", | |
"America/Marigot" => "Atlantic Time (Canada)", | |
"America/Martinique" => "Atlantic Time (Canada)", | |
"America/Moncton" => "Atlantic Time (Canada)", | |
"America/Montserrat" => "Atlantic Time (Canada)", | |
"America/Porto_Velho" => "Atlantic Time (Canada)", | |
"America/Port_of_Spain" => "Atlantic Time (Canada)", | |
"America/Puerto_Rico" => "Atlantic Time (Canada)", | |
"America/Rio_Branco" => "Atlantic Time (Canada)", | |
"America/Santo_Domingo" => "Atlantic Time (Canada)", | |
"America/St_Barthelemy" => "Atlantic Time (Canada)", | |
"America/St_Kitts" => "Atlantic Time (Canada)", | |
"America/St_Lucia" => "Atlantic Time (Canada)", | |
"America/St_Thomas" => "Atlantic Time (Canada)", | |
"America/St_Vincent" => "Atlantic Time (Canada)", | |
"America/Thule" => "Atlantic Time (Canada)", | |
"America/Tortola" => "Atlantic Time (Canada)", | |
"Antarctica/Palmer" => "Atlantic Time (Canada)", | |
"Atlantic/Bermuda" => "Atlantic Time (Canada)", | |
"Atlantic/Stanley" => "Atlantic Time (Canada)", | |
"Antarctica/McMurdo" => "Auckland", | |
"Antarctica/South_Pole" => "Auckland", | |
"Pacific/Auckland" => "Auckland", | |
"Pacific/Funafuti" => "Auckland", | |
"Pacific/Kwajalein" => "Auckland", | |
"Pacific/Majuro" => "Auckland", | |
"Pacific/Nauru" => "Auckland", | |
"Pacific/Tarawa" => "Auckland", | |
"Pacific/Wake" => "Auckland", | |
"Pacific/Wallis" => "Auckland", | |
"Atlantic/Azores" => "Azores", | |
"Asia/Baghdad" => "Baghdad", | |
"Asia/Baku" => "Baku", | |
"Asia/Dubai" => "Baku", | |
"Indian/Mahe" => "Baku", | |
"Indian/Mauritius" => "Baku", | |
"Indian/Reunion" => "Baku", | |
"Asia/Bangkok" => "Bangkok", | |
"Europe/Belgrade" => "Belgrade", | |
"Europe/Berlin" => "Berlin", | |
"America/Bogota" => "Bogota", | |
"Europe/Bratislava" => "Bratislava", | |
"Australia/Brisbane" => "Brisbane", | |
"Europe/Brussels" => "Brussels", | |
"Europe/Bucharest" => "Bucharest", | |
"Europe/Budapest" => "Budapest", | |
"America/Araguaina" => "Buenos Aires", | |
"America/Argentina/Buenos_Aires" => "Buenos Aires", | |
"America/Argentina/Catamarca" => "Buenos Aires", | |
"America/Argentina/Cordoba" => "Buenos Aires", | |
"America/Argentina/Jujuy" => "Buenos Aires", | |
"America/Argentina/La_Rioja" => "Buenos Aires", | |
"America/Argentina/Mendoza" => "Buenos Aires", | |
"America/Argentina/Rio_Gallegos" => "Buenos Aires", | |
"America/Argentina/Salta" => "Buenos Aires", | |
"America/Argentina/San_Juan" => "Buenos Aires", | |
"America/Argentina/Tucuman" => "Buenos Aires", | |
"America/Argentina/Ushuaia" => "Buenos Aires", | |
"America/Bahia" => "Buenos Aires", | |
"America/Belem" => "Buenos Aires", | |
"America/Cayenne" => "Buenos Aires", | |
"America/Fortaleza" => "Buenos Aires", | |
"America/Godthab" => "Buenos Aires", | |
"America/Maceio" => "Buenos Aires", | |
"America/Miquelon" => "Buenos Aires", | |
"America/Montevideo" => "Buenos Aires", | |
"America/Paramaribo" => "Buenos Aires", | |
"America/Recife" => "Buenos Aires", | |
"America/Santarem" => "Buenos Aires", | |
"America/Sao_Paulo" => "Buenos Aires", | |
"Antarctica/Rothera" => "Buenos Aires", | |
"Africa/Blantyre" => "Cairo", | |
"Africa/Bujumbura" => "Cairo", | |
"Africa/Cairo" => "Cairo", | |
"Africa/Gaborone" => "Cairo", | |
"Africa/Johannesburg" => "Cairo", | |
"Africa/Kigali" => "Cairo", | |
"Africa/Lubumbashi" => "Cairo", | |
"Africa/Lusaka" => "Cairo", | |
"Africa/Maputo" => "Cairo", | |
"Africa/Maseru" => "Cairo", | |
"Africa/Mbabane" => "Cairo", | |
"Africa/Tripoli" => "Cairo", | |
"Asia/Amman" => "Cairo", | |
"Asia/Beirut" => "Cairo", | |
"Asia/Damascus" => "Cairo", | |
"Asia/Gaza" => "Cairo", | |
"Asia/Nicosia" => "Cairo", | |
"Europe/Chisinau" => "Cairo", | |
"Europe/Kaliningrad" => "Cairo", | |
"Europe/Kiev" => "Cairo", | |
"Europe/Mariehamn" => "Cairo", | |
"Europe/Simferopol" => "Cairo", | |
"Europe/Uzhgorod" => "Cairo", | |
"Europe/Zaporozhye" => "Cairo", | |
"America/Scoresbysund" => "Cape Verde Is.", | |
"Atlantic/Cape_Verde" => "Cape Verde Is.", | |
"America/Caracas" => "Caracas", | |
"Africa/Casablanca" => "Casablanca", | |
"America/Belize" => "Central Time (US & Canada)", | |
"America/Cancun" => "Central Time (US & Canada)", | |
"America/Chicago" => "Central Time (US & Canada)", | |
"America/Costa_Rica" => "Central Time (US & Canada)", | |
"America/El_Salvador" => "Central Time (US & Canada)", | |
"America/Guatemala" => "Central Time (US & Canada)", | |
"America/Indiana/Knox" => "Central Time (US & Canada)", | |
"America/Indiana/Tell_City" => "Central Time (US & Canada)", | |
"America/Managua" => "Central Time (US & Canada)", | |
"America/Matamoros" => "Central Time (US & Canada)", | |
"America/Menominee" => "Central Time (US & Canada)", | |
"America/Merida" => "Central Time (US & Canada)", | |
"America/North_Dakota/Center" => "Central Time (US & Canada)", | |
"America/North_Dakota/New_Salem" => "Central Time (US & Canada)", | |
"America/Rainy_River" => "Central Time (US & Canada)", | |
"America/Rankin_Inlet" => "Central Time (US & Canada)", | |
"America/Regina" => "Central Time (US & Canada)", | |
"America/Swift_Current" => "Central Time (US & Canada)", | |
"America/Tegucigalpa" => "Central Time (US & Canada)", | |
"America/Winnipeg" => "Central Time (US & Canada)", | |
"Pacific/Easter" => "Central Time (US & Canada)", | |
"Pacific/Galapagos" => "Central Time (US & Canada)", | |
"America/Chihuahua" => "Chihuahua", | |
"Asia/Chongqing" => "Chongqing", | |
"Europe/Copenhagen" => "Copenhagen", | |
"Australia/Darwin" => "Darwin", | |
"Antarctica/Mawson" => "Dhaka", | |
"Asia/Bishkek" => "Dhaka", | |
"Asia/Dhaka" => "Dhaka", | |
"Asia/Karachi" => "Dhaka", | |
"Asia/Novokuznetsk" => "Dhaka", | |
"Asia/Omsk" => "Dhaka", | |
"Asia/Qyzylorda" => "Dhaka", | |
"Asia/Thimphu" => "Dhaka", | |
"Indian/Chagos" => "Dhaka", | |
"Europe/Dublin" => "Dublin", | |
"America/Atikokan" => "Eastern Time (US & Canada)", | |
"America/Cayman" => "Eastern Time (US & Canada)", | |
"America/Detroit" => "Eastern Time (US & Canada)", | |
"America/Grand_Turk" => "Eastern Time (US & Canada)", | |
"America/Guayaquil" => "Eastern Time (US & Canada)", | |
"America/Havana" => "Eastern Time (US & Canada)", | |
"America/Indiana/Indianapolis" => "Eastern Time (US & Canada)", | |
"America/Indiana/Marengo" => "Eastern Time (US & Canada)", | |
"America/Indiana/Petersburg" => "Eastern Time (US & Canada)", | |
"America/Indiana/Vevay" => "Eastern Time (US & Canada)", | |
"America/Indiana/Vincennes" => "Eastern Time (US & Canada)", | |
"America/Indiana/Winamac" => "Eastern Time (US & Canada)", | |
"America/Iqaluit" => "Eastern Time (US & Canada)", | |
"America/Jamaica" => "Eastern Time (US & Canada)", | |
"America/Kentucky/Louisville" => "Eastern Time (US & Canada)", | |
"America/Kentucky/Monticello" => "Eastern Time (US & Canada)", | |
"America/Montreal" => "Eastern Time (US & Canada)", | |
"America/Nassau" => "Eastern Time (US & Canada)", | |
"America/New_York" => "Eastern Time (US & Canada)", | |
"America/Nipigon" => "Eastern Time (US & Canada)", | |
"America/Panama" => "Eastern Time (US & Canada)", | |
"America/Pangnirtung" => "Eastern Time (US & Canada)", | |
"America/Port-au-Prince" => "Eastern Time (US & Canada)", | |
"America/Resolute" => "Eastern Time (US & Canada)", | |
"America/Thunder_Bay" => "Eastern Time (US & Canada)", | |
"America/Toronto" => "Eastern Time (US & Canada)", | |
"Pacific/Fiji" => "Fiji", | |
"Pacific/Guam" => "Guam", | |
"Africa/Harare" => "Harare", | |
"America/Adak" => "Hawaii", | |
"Pacific/Fakaofo" => "Hawaii", | |
"Pacific/Honolulu" => "Hawaii", | |
"Pacific/Johnston" => "Hawaii", | |
"Pacific/Rarotonga" => "Hawaii", | |
"Pacific/Tahiti" => "Hawaii", | |
"Europe/Helsinki" => "Helsinki", | |
"Australia/Hobart" => "Hobart", | |
"Antarctica/Casey" => "Hong Kong", | |
"Asia/Brunei" => "Hong Kong", | |
"Asia/Choibalsan" => "Hong Kong", | |
"Asia/Harbin" => "Hong Kong", | |
"Asia/Hong_Kong" => "Hong Kong", | |
"Asia/Kashgar" => "Hong Kong", | |
"Asia/Kuching" => "Hong Kong", | |
"Asia/Macau" => "Hong Kong", | |
"Asia/Makassar" => "Hong Kong", | |
"Asia/Manila" => "Hong Kong", | |
"Asia/Shanghai" => "Hong Kong", | |
"Asia/Ulaanbaatar" => "Hong Kong", | |
"Asia/Irkutsk" => "Irkutsk", | |
"Europe/Istanbul" => "Istanbul", | |
"Antarctica/Davis" => "Jakarta", | |
"Asia/Hovd" => "Jakarta", | |
"Asia/Ho_Chi_Minh" => "Jakarta", | |
"Asia/Jakarta" => "Jakarta", | |
"Asia/Phnom_Penh" => "Jakarta", | |
"Asia/Pontianak" => "Jakarta", | |
"Asia/Vientiane" => "Jakarta", | |
"Indian/Christmas" => "Jakarta", | |
"Asia/Jerusalem" => "Jerusalem", | |
"Asia/Kabul" => "Kabul", | |
"Asia/Kamchatka" => "Kamchatka", | |
"Asia/Aqtau" => "Karachi", | |
"Asia/Aqtobe" => "Karachi", | |
"Asia/Ashgabat" => "Karachi", | |
"Asia/Dushanbe" => "Karachi", | |
"Asia/Oral" => "Karachi", | |
"Asia/Samarkand" => "Karachi", | |
"Asia/Yekaterinburg" => "Karachi", | |
"Indian/Kerguelen" => "Karachi", | |
"Indian/Maldives" => "Karachi", | |
"Asia/Kathmandu" => "Kathmandu", | |
"Asia/Kolkata" => "Kolkata", | |
"Asia/Krasnoyarsk" => "Krasnoyarsk", | |
"Asia/Kuala_Lumpur" => "Kuala Lumpur", | |
"Asia/Kuwait" => "Kuwait", | |
"America/La_Paz" => "La Paz", | |
"America/Lima" => "Lima", | |
"Europe/Lisbon" => "Lisbon", | |
"Europe/Ljubljana" => "Ljubljana", | |
"Africa/Abidjan" => "London", | |
"Africa/Accra" => "London", | |
"Africa/Bamako" => "London", | |
"Africa/Banjul" => "London", | |
"Africa/Bissau" => "London", | |
"Africa/Conakry" => "London", | |
"Africa/Dakar" => "London", | |
"Africa/El_Aaiun" => "London", | |
"Africa/Freetown" => "London", | |
"Africa/Lome" => "London", | |
"Africa/Nouakchott" => "London", | |
"Africa/Ouagadougou" => "London", | |
"Africa/Sao_Tome" => "London", | |
"America/Danmarkshavn" => "London", | |
"Antarctica/Vostok" => "London", | |
"Atlantic/Canary" => "London", | |
"Atlantic/Faroe" => "London", | |
"Atlantic/Madeira" => "London", | |
"Atlantic/Reykjavik" => "London", | |
"Atlantic/St_Helena" => "London", | |
"Europe/Guernsey" => "London", | |
"Europe/Isle_of_Man" => "London", | |
"Europe/Jersey" => "London", | |
"Europe/London" => "London", | |
"Europe/Madrid" => "Madrid", | |
"Asia/Magadan" => "Magadan", | |
"America/Mazatlan" => "Mazatlan", | |
"Australia/Melbourne" => "Melbourne", | |
"America/Mexico_City" => "Mexico City", | |
"America/Noronha" => "Mid-Atlantic", | |
"Atlantic/South_Georgia" => "Mid-Atlantic", | |
"Europe/Minsk" => "Minsk", | |
"Africa/Monrovia" => "Monrovia", | |
"America/Monterrey" => "Monterrey", | |
"Africa/Addis_Ababa" => "Moscow", | |
"Africa/Asmara" => "Moscow", | |
"Africa/Dar_es_Salaam" => "Moscow", | |
"Africa/Djibouti" => "Moscow", | |
"Africa/Kampala" => "Moscow", | |
"Africa/Khartoum" => "Moscow", | |
"Africa/Mogadishu" => "Moscow", | |
"Antarctica/Syowa" => "Moscow", | |
"Asia/Aden" => "Moscow", | |
"Asia/Bahrain" => "Moscow", | |
"Asia/Qatar" => "Moscow", | |
"Europe/Moscow" => "Moscow", | |
"Europe/Samara" => "Moscow", | |
"Indian/Antananarivo" => "Moscow", | |
"Indian/Comoro" => "Moscow", | |
"Indian/Mayotte" => "Moscow", | |
"America/Boise" => "Mountain Time (US & Canada)", | |
"America/Cambridge_Bay" => "Mountain Time (US & Canada)", | |
"America/Dawson_Creek" => "Mountain Time (US & Canada)", | |
"America/Denver" => "Mountain Time (US & Canada)", | |
"America/Edmonton" => "Mountain Time (US & Canada)", | |
"America/Hermosillo" => "Mountain Time (US & Canada)", | |
"America/Inuvik" => "Mountain Time (US & Canada)", | |
"America/Ojinaga" => "Mountain Time (US & Canada)", | |
"America/Phoenix" => "Mountain Time (US & Canada)", | |
"America/Shiprock" => "Mountain Time (US & Canada)", | |
"America/Yellowknife" => "Mountain Time (US & Canada)", | |
"Asia/Colombo" => "Mumbai", | |
"Asia/Muscat" => "Muscat", | |
"Africa/Nairobi" => "Nairobi", | |
"America/St_Johns" => "Newfoundland", | |
"Asia/Novosibirsk" => "Novosibirsk", | |
"Pacific/Enderbury" => "Nuku'alofa", | |
"Pacific/Tongatapu" => "Nuku'alofa", | |
"America/Dawson" => "Pacific Time (US & Canada)", | |
"America/Los_Angeles" => "Pacific Time (US & Canada)", | |
"America/Santa_Isabel" => "Pacific Time (US & Canada)", | |
"America/Vancouver" => "Pacific Time (US & Canada)", | |
"America/Whitehorse" => "Pacific Time (US & Canada)", | |
"Pacific/Pitcairn" => "Pacific Time (US & Canada)", | |
"Africa/Algiers" => "Paris", | |
"Africa/Bangui" => "Paris", | |
"Africa/Brazzaville" => "Paris", | |
"Africa/Ceuta" => "Paris", | |
"Africa/Douala" => "Paris", | |
"Africa/Kinshasa" => "Paris", | |
"Africa/Lagos" => "Paris", | |
"Africa/Libreville" => "Paris", | |
"Africa/Luanda" => "Paris", | |
"Africa/Malabo" => "Paris", | |
"Africa/Ndjamena" => "Paris", | |
"Africa/Niamey" => "Paris", | |
"Africa/Porto-Novo" => "Paris", | |
"Africa/Tunis" => "Paris", | |
"Africa/Windhoek" => "Paris", | |
"Arctic/Longyearbyen" => "Paris", | |
"Europe/Andorra" => "Paris", | |
"Europe/Gibraltar" => "Paris", | |
"Europe/Luxembourg" => "Paris", | |
"Europe/Malta" => "Paris", | |
"Europe/Monaco" => "Paris", | |
"Europe/Oslo" => "Paris", | |
"Europe/Paris" => "Paris", | |
"Europe/Podgorica" => "Paris", | |
"Europe/San_Marino" => "Paris", | |
"Europe/Tirane" => "Paris", | |
"Europe/Vaduz" => "Paris", | |
"Europe/Vatican" => "Paris", | |
"Europe/Zurich" => "Paris", | |
"Australia/Perth" => "Perth", | |
"Pacific/Port_Moresby" => "Port Moresby", | |
"Europe/Prague" => "Prague", | |
"Asia/Rangoon" => "Rangoon", | |
"Indian/Cocos" => "Rangoon", | |
"Europe/Riga" => "Riga", | |
"Asia/Riyadh" => "Riyadh", | |
"Europe/Rome" => "Rome", | |
"Pacific/Apia" => "Samoa", | |
"Pacific/Midway" => "Samoa", | |
"Pacific/Niue" => "Samoa", | |
"Pacific/Pago_Pago" => "Samoa", | |
"America/Santiago" => "Santiago", | |
"Europe/Sarajevo" => "Sarajevo", | |
"Asia/Seoul" => "Seoul", | |
"Asia/Singapore" => "Singapore", | |
"Europe/Skopje" => "Skopje", | |
"Europe/Sofia" => "Sofia", | |
"Asia/Anadyr" => "Solomon Is.", | |
"Pacific/Efate" => "Solomon Is.", | |
"Pacific/Guadalcanal" => "Solomon Is.", | |
"Pacific/Kosrae" => "Solomon Is.", | |
"Pacific/Noumea" => "Solomon Is.", | |
"Pacific/Ponape" => "Solomon Is.", | |
"Europe/Stockholm" => "Stockholm", | |
"Antarctica/DumontDUrville" => "Sydney", | |
"Asia/Sakhalin" => "Sydney", | |
"Australia/Currie" => "Sydney", | |
"Australia/Lindeman" => "Sydney", | |
"Australia/Sydney" => "Sydney", | |
"Pacific/Saipan" => "Sydney", | |
"Pacific/Truk" => "Sydney", | |
"Asia/Taipei" => "Taipei", | |
"Europe/Tallinn" => "Tallinn", | |
"Asia/Tashkent" => "Tashkent", | |
"Asia/Tbilisi" => "Tbilisi", | |
"Asia/Tehran" => "Tehran", | |
"America/Tijuana" => "Tijuana", | |
"Asia/Dili" => "Tokyo", | |
"Asia/Jayapura" => "Tokyo", | |
"Asia/Pyongyang" => "Tokyo", | |
"Asia/Tokyo" => "Tokyo", | |
"Pacific/Palau" => "Tokyo", | |
"Asia/Urumqi" => "Urumqi", | |
"Europe/Vienna" => "Vienna", | |
"Europe/Vilnius" => "Vilnius", | |
"Asia/Vladivostok" => "Vladivostok", | |
"Europe/Volgograd" => "Volgograd", | |
"Europe/Warsaw" => "Warsaw", | |
"Asia/Yakutsk" => "Yakutsk", | |
"Asia/Yerevan" => "Yerevan", | |
"Europe/Zagreb" => "Zagreb", | |
} |
Very useful! Thanks!
Anyone planning to use this should note that it's missing the Arizona Timezone:
> ActiveSupport::TimeZone.us_zones.map(&:name)
=> ["Hawaii", "Alaska", "Pacific Time (US & Canada)", "Arizona", "Mountain Time (US & Canada)", "Central Time (US & Canada)", "Eastern Time (US & Canada)", "Indiana (East)"]
@swrobel Arizona
(and maybe others) must be new since this was written in 2011. The original blog post in archived at http://web.archive.org/web/20120822134942/http://blog.slashpoundbang.com/post/2613268281/changing-from-tz-database-identifiers-to-rails-friendly
It looks like this list doesn't properly account for daylight savings. I'll give an example:
The Rails time zone "Central Time (US & Canada)" is −6 (Central Standard Time) but in the summer months it observes daylight savings and becomes −5 (Central Daylight Time).
Contrast this this with the Rails time zone "Central America," which is −6 all year round.
Now take a look at the tz database zone "America/Belize." This zone is also −6 all year round. So it shouldn't map to the Rails zone "Central Time (US & Canada)" but rather to "Central America."
You can check this yourself in IRB:
tz = ActiveSupport::TimeZone.new("Central Time (US & Canada)")
=> #<ActiveSupport::TimeZone:0x007fa47bd9aa18 @name="Central Time (US & Canada)", @utc_offset=nil, @tzinfo=#<TZInfo::TimezoneProxy: America/Chicago>, @current_period=#<TZInfo::TimezonePeriod: #<TZInfo::TimezoneTransitionDefinition: #<TZInfo::TimeOrDateTime: 1489305600>,#<TZInfo::TimezoneOffset: -21600,3600,CDT>>,#<TZInfo::TimezoneTransitionDefinition: #<TZInfo::TimeOrDateTime: 1509865200>,#<TZInfo::TimezoneOffset: -21600,0,CST>>>>
tz.now
=> Thu, 29 Jun 2017 17:23:29 CDT -05:00
tz.now + 6.months
=> Fri, 29 Dec 2017 17:23:36 CST -06:00
tz = ActiveSupport::TimeZone.new("Central America")
=> #<ActiveSupport::TimeZone:0x007fa47bd818b0 @name="Central America", @utc_offset=nil, @tzinfo=#<TZInfo::TimezoneProxy: America/Guatemala>, @current_period=#<TZInfo::TimezonePeriod: #<TZInfo::TimezoneTransitionDefinition: #<TZInfo::TimeOrDateTime: 1159678800>,#<TZInfo::TimezoneOffset: -21600,0,CST>>,nil>>
tz.now
=> Thu, 29 Jun 2017 16:23:53 CST -06:00
tz.now + 6.months
=> Fri, 29 Dec 2017 16:24:02 CST -06:00
tz = ActiveSupport::TimeZone.new("America/Belize")
=> #<ActiveSupport::TimeZone:0x007fa47bd58d20 @name="America/Belize", @utc_offset=nil, @tzinfo=#<TZInfo::TimezoneProxy: America/Belize>, @current_period=#<TZInfo::TimezonePeriod: #<TZInfo::TimezoneTransitionDefinition: #<TZInfo::TimeOrDateTime: 413874000>,#<TZInfo::TimezoneOffset: -21600,0,CST>>,nil>>
tz.now
=> Thu, 29 Jun 2017 16:24:19 CST -06:00
tz.now + 6.months
=> Fri, 29 Dec 2017 16:24:21 CST -06:00
These are the Rails time zone names missing other than "Arizona":
>> (ActiveSupport::TimeZone::MAPPING.keys - the_hash.values.uniq).sort
=> ["Abu Dhabi", "American Samoa", "Arizona", "Astana", "Beijing", "Bern", "Brasilia", "Canberra", "Central America", "Chatham Is.", "Chennai", "Edinburgh", "Ekaterinburg", "Georgetown", "Greenland", "Guadalajara", "Hanoi", "Indiana (East)", "International Date Line West", "Islamabad", "Kaliningrad", "Kyiv", "Marshall Is.", "Midway Island", "Montevideo", "New Caledonia", "New Delhi", "Osaka", "Pretoria", "Puerto Rico", "Quito", "Samara", "Sapporo", "Saskatchewan", "Srednekolymsk", "Sri Jayawardenepura", "St. Petersburg", "Tokelau Is.", "UTC", "Ulaanbaatar", "Wellington", "Zurich"]
And these are the IANA time zone names (long names like "Europe/Stockholm") that Rails supports in its mapping but that this hash does not include:
>> (ActiveSupport::TimeZone::MAPPING.values - the_hash.keys.uniq).sort
=> ["Asia/Srednekolymsk", "Etc/GMT+12", "Etc/UTC", "Pacific/Chatham"]
So if you want to convert from IANA time zone names to Rails time zone names, I guess the best thing (until someone revisits the hash) is to combine them:
key = "Australia/Broken_Hill"
ActiveSupport::TimeZone::MAPPING.invert[key] || the_hash[key]
# => "Adelaide"
The actual mappings used by Ruby are here: https://github.com/rails/rails/blob/master/activesupport/lib/active_support/values/time_zone.rb
They include the above missing parts
Edit: for reverse mappings, I found a more comprehensive list here: https://gist.github.com/stevelacey/0c8656a0129b415843b0
Thanks!