Skip to content

Instantly share code, notes, and snippets.

@wnuqui
Created July 3, 2012 09:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wnuqui/3038693 to your computer and use it in GitHub Desktop.
Save wnuqui/3038693 to your computer and use it in GitHub Desktop.
switch zone
def Time.using_zone_of(zone)
Time.zone = zone
yield
Time.zone = 'UTC'
end
Time.using_zone_of("Hawaii") do
puts Time.zone.now
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment