Created
March 2, 2015 18:01
-
-
Save m3nd3s/1d2ee854f423f1ca06d7 to your computer and use it in GitHub Desktop.
Conversor de timezone
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 characters
file = File.new("/Users/m3nd3s/Desktop/schedule.txt", 'r') | |
begin | |
report = File.open("/Users/m3nd3s/Desktop/report.txt", 'w') | |
while(line = file.gets) | |
cols = line.split(" - ") | |
utc_time = DateTime.parse(cols[0]) | |
br_time = utc_time.in_time_zone('Brasilia') | |
report.puts "#{cols[1].strip}: #{br_time}" | |
end | |
ensure | |
report.close if report | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment