Skip to content

Instantly share code, notes, and snippets.

@tensiondriven
Created December 28, 2011 17:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tensiondriven/1528698 to your computer and use it in GitHub Desktop.
Save tensiondriven/1528698 to your computer and use it in GitHub Desktop.
Get list of all zones where it is midnight
zones_where_it_is_midnight = []
ActiveSupport::TimeZone.zones_map.each{ |zone|
if (Time.now.in_time_zone(zone[1]).strftime('%k').to_i == 0)
zones_where_it_is_midnight << zone[0]
end
}
puts zones_where_it_is_midnight.inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment