Skip to content

Instantly share code, notes, and snippets.

@jccarbonfive
Created July 5, 2012 18:56
Show Gist options
  • Save jccarbonfive/3055704 to your computer and use it in GitHub Desktop.
Save jccarbonfive/3055704 to your computer and use it in GitHub Desktop.
Time.use_zone usage
>> Time.zone
=> (GMT+00:00) UTC
>> Time.use_zone('America/Los_Angeles') { puts Time.zone }
(GMT-08:00) America/Los_Angeles
=> nil
>> Time.zone
=> (GMT+00:00) UTC
@Meekohi
Copy link

Meekohi commented Apr 26, 2017

Also can do

Time.use_zone('America/Los_Angeles') do
  puts Time.zone
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment