Skip to content

Instantly share code, notes, and snippets.

@mikebaldry
Created October 31, 2012 16:15
Show Gist options
  • Save mikebaldry/3987978 to your computer and use it in GitHub Desktop.
Save mikebaldry/3987978 to your computer and use it in GitHub Desktop.
Timezones...
1.9.3p194 :012 > ActiveSupport::TimeZone["America/New_York"]
=> (GMT-05:00) America/New_York
1.9.3p194 :013 > DateTime.now.utc
=> Wed, 31 Oct 2012 16:15:11 +0000
1.9.3p194 :014 > ActiveSupport::TimeZone["America/New_York"].utc_to_local(DateTime.now.utc)
=> Wed, 31 Oct 2012 12:15:18 +0000
1.9.3p194 :015 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment