Created
July 26, 2011 03:47
-
-
Save YenTheFirst/1105918 to your computer and use it in GitHub Desktop.
WTF ActiveSupport::TimeZone
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rails console | |
> a = Time.zone.now # => Mon, 25 Jul 2011 23:47:52 EDT -04:00 | |
> b = Time.zone.parse(a.to_s) # => Mon, 25 Jul 2011 23:47:52 EDT -04:00 | |
> c = Time.zone.parse(a.strftime("%Y-%m-%d %H:%M:%S.%N %z")) # => Mon, 25 Jul 2011 23:47:52 EDT -04:00 | |
> a == b # => false | |
> a == c # => true | |
> a.nsec # => 583744338 | |
> b.nsec # => 0 | |
> c.nsec # => 583744338 | |
# map != territory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment