Skip to content

Instantly share code, notes, and snippets.

@speric
Last active August 29, 2015 14:15
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 speric/41c9b4e4f53e51e91e06 to your computer and use it in GitHub Desktop.
Save speric/41c9b4e4f53e51e91e06 to your computer and use it in GitHub Desktop.
Time.zone.parse differences depending on mm dd yyyy separator character
# Rails 3.2.21, ruby 2.0.0p353

# 'American' style
> Time.zone.parse("11/12/2012 10:10")
=> Mon, 12 Nov 2012 10:10:00 EST -05:00

# 'Rest of the world' style
> Time.zone.parse("11-12-2012 10:10")
=> Tue, 11 Dec 2012 10:10:00 EST -05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment