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(main):001:0> require 'active_support/core_ext' | |
=> true | |
irb(main):002:0> x = Date.new(2001) | |
=> Mon, 01 Jan 2001 | |
irb(main):003:0> x - 1.second | |
=> 2000-12-31 23:59:59 -0500 | |
irb(main):004:0> y = DateTime.new(2001) | |
=> Mon, 01 Jan 2001 00:00:00 +0000 | |
irb(main):005:0> y - 1.second | |
TypeError: expected numeric or date |
NewerOlder