Skip to content

Instantly share code, notes, and snippets.

@natritmeyer
Created August 29, 2012 21:18
Show Gist options
  • Save natritmeyer/3519108 to your computer and use it in GitHub Desktop.
Save natritmeyer/3519108 to your computer and use it in GitHub Desktop.
Make your tests run in any timezone...
#in env.rb:
require 'active_support/time'
Time.zone = 'Europe/London'
#use in tests instead of `Time.now`:
Time.current #=> will output the time in London, regardless of the localhost's timezone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment