Skip to content

Instantly share code, notes, and snippets.

@jarkko
Created March 20, 2012 11:02
Show Gist options
  • Save jarkko/2134102 to your computer and use it in GitHub Desktop.
Save jarkko/2134102 to your computer and use it in GitHub Desktop.
Rails Time.zone.parse bug
1.9.3p125 :003 > Time.zone = "Pacific Time (US & Canada)"
=> "Pacific Time (US & Canada)"
1.9.3p125 :004 > Time.zone
=> (GMT-08:00) Pacific Time (US & Canada)
1.9.3p125 :005 > Time.zone.parse("2012-03-25 03:29")
=> Sun, 25 Mar 2012 04:29:00 PDT -07:00
1.9.3p125 :006 > Time.zone.parse("2012-03-24 03:29")
=> Sat, 24 Mar 2012 03:29:00 PDT -07:00
1.9.3p125 :007 > Time.zone = "UTC"
=> "UTC"
1.9.3p125 :008 > Time.zone
=> (GMT+00:00) UTC
1.9.3p125 :009 > Time.zone.parse("2012-03-25 03:29")
=> Sun, 25 Mar 2012 04:29:00 UTC +00:00
1.9.3p125 :010 > Time.zone.parse("2012-03-24 03:29")
=> Sat, 24 Mar 2012 03:29:00 UTC +00:00
@jarkko
Copy link
Author

jarkko commented Mar 23, 2012

...and a pull request: rails/rails#5560

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment