Skip to content

Instantly share code, notes, and snippets.

@ayosec
Created July 11, 2012 13:28
Show Gist options
  • Save ayosec/3090382 to your computer and use it in GitHub Desktop.
Save ayosec/3090382 to your computer and use it in GitHub Desktop.
Force UTC times
class Hash
def times_with_utc
dup.tap do |new_hash|
each_key do |key|
value = self[key]
if value.is_a?(ActiveSupport::TimeWithZone)
new_hash[key] = value.utc
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment