Skip to content

Instantly share code, notes, and snippets.

@groman-me
Created September 3, 2012 22:13
Show Gist options
  • Save groman-me/3614049 to your computer and use it in GitHub Desktop.
Save groman-me/3614049 to your computer and use it in GitHub Desktop.
Get time in current time zone
# Time.local returns time in Time zone of your machine:
Time.local(2012,8,31)
# => Fri Aug 31 00:00:00 +0400 2012
# Time.zone.local returns time in Time zone of your application
Time.zone.local(2012,10,31)
# => Wed, 31 Oct 2012 00:00:00 EET +02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment