Skip to content

Instantly share code, notes, and snippets.

@jamesgecko
Created November 21, 2012 04:30
Show Gist options
  • Select an option

  • Save jamesgecko/4123029 to your computer and use it in GitHub Desktop.

Select an option

Save jamesgecko/4123029 to your computer and use it in GitHub Desktop.
TimeWithZone oddity
[49] pry(main)> a = Time.zone.now
=> Wed, 21 Nov 2012 04:28:07 UTC +00:00
[50] pry(main)> b = a.to_s
=> "2012-11-21 04:28:07 UTC"
[51] pry(main)> c = Time.zone.parse(b)
=> Wed, 21 Nov 2012 04:28:07 UTC +00:00
[52] pry(main)> a == c
=> false
[57] pry(main)> a.class
=> ActiveSupport::TimeWithZone
[58] pry(main)> c.class
=> ActiveSupport::TimeWithZone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment