ruby-on-railsrubydatetimetimezone

How can I get the utc offset in Rails?


I need the utc offset from the timezone specified.


Solution

  • require 'time'
    
    p Time.zone_offset('EST') #=> -18000  #(-5*60*60)