Skip to content

Instantly share code, notes, and snippets.

@m3nd3s
Created March 2, 2015 18:01
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 m3nd3s/1d2ee854f423f1ca06d7 to your computer and use it in GitHub Desktop.
Save m3nd3s/1d2ee854f423f1ca06d7 to your computer and use it in GitHub Desktop.
Conversor de timezone
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