Last active
August 29, 2015 14:22
-
-
Save bradpauly/acb7d691a412580a9cdc to your computer and use it in GitHub Desktop.
This file contains 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 characters
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