Method: Time#to_UTC

Defined in:
lib/hackapp_gem.rb

#to_UTCObject

times in database are eastern time to add 5 hours to all



6
7
8
9
10
11
12
13
14
# File 'lib/hackapp_gem.rb', line 6

def to_UTC
  begin
    shift_to_UTC = 5 if Time.new.zone == "EST"
    shift_to_UTC = 4 if Time.new.zone == "EDT"
    self.to_datetime.advance(:hours => shift_to_UTC).to_datetime
  rescue Exception => e
    puts "Unrecognizeable timezone: #{e}"
  end
end