Skip to content

Instantly share code, notes, and snippets.

@bradpauly
Last active August 29, 2015 14:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradpauly/acb7d691a412580a9cdc to your computer and use it in GitHub Desktop.
Save bradpauly/acb7d691a412580a9cdc to your computer and use it in GitHub Desktop.
require 'TZInfo'
today = Time.now
(0..23).each do |hour|
(0..45).each do |minute|
utc_time_to_check = Time.utc(today.year, today.month, today.day, hour, minute, 0)
TZInfo::Timezone.all_identifiers.each do |zone_name|
local_tz = TZInfo::Timezone.get(zone_name)
local_time = local_tz.utc_to_local(utc_time_to_check).to_datetime
if local_time.minute == 0 && local_time.hour == 8
puts utc_time_to_check.strftime("%H:%M") + ' UTC => ' + local_time.strftime("%H:%M") + ' in ' + zone_name
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment