Skip to content

Instantly share code, notes, and snippets.

@m3nd3s
Created March 2, 2015 18:01
Show Gist options
  • Save m3nd3s/1d2ee854f423f1ca06d7 to your computer and use it in GitHub Desktop.
Save m3nd3s/1d2ee854f423f1ca06d7 to your computer and use it in GitHub Desktop.

Revisions

  1. m3nd3s created this gist Mar 2, 2015.
    15 changes: 15 additions & 0 deletions timezone.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    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