Skip to content

Instantly share code, notes, and snippets.

@seancribbs
Created September 4, 2009 22:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seancribbs/181197 to your computer and use it in GitHub Desktop.
Save seancribbs/181197 to your computer and use it in GitHub Desktop.
def timezone=(value)
# Normalizes TZInfo names into their Rails equivalents
Time.use_zone(value) do
self[:timezone] = ActiveSupport::TimeZone::MAPPING.index(Time.zone.name) || Time.zone.name
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment