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
ELEMENTS | |
E1 | |
E2 | |
E8 | |
E9 | |
E4 | |
E5 | |
E6 |
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
$ irb | |
>> require 'date' | |
=> true | |
# DateTime ignores time zone | |
>> DateTime.new(2012,9,10) | |
=> #<DateTime: 2012-09-10T00:00:00+00:00 ((2456181j,0s,0n),+0s,2299161j)> | |
# Time handles offset correctly | |
>> Time.new(2012, 9, 10) |
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
# | |
# freezing DateTime.now | |
# | |
# in Rails | |
$ rails c | |
Loading development environment (Rails 3.2.8) | |
# DateTime and Time have milliseconds before freezing time | |
>> DateTime.now.iso8601 9 |
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
$ irb | |
>> DateTime.now | |
=> #<DateTime: 2012-10-29T16:00:33+01:00 ((2456230j,54033s,774400000n),+3600s,2299161j)> | |
>> DateTime.now - 1 | |
=> #<DateTime: 2012-10-28T16:00:37+01:00 ((2456229j,54037s,137431000n),+3600s,2299161j)> | |
$ rails c | |
>> DateTime.now.iso8601 9 | |
=> "2012-10-29T16:03:17.237282000+01:00" |