Created
June 20, 2014 21:24
-
-
Save kueda/3e6f77f64f792b4f119f to your computer and use it in GitHub Desktop.
Revisions
-
kueda created this gist
Jun 20, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ abbrevs = {} TZInfo::Timezone.all.each do |tz| tz = tz.send(:real_timezone) unless tz.class == TZInfo::Timezone tzi = tz.send(:info) offsets = tzi.instance_variable_get(:@offsets) next if offsets.blank? offsets.values.each do |offset| abbrevs[offset.abbreviation] ||= [] abbrevs[offset.abbreviation] << tz.identifier end end