Return receiver (for DateTime/Time conversion protocol).
DateTime.now.to_datetime #=> #<DateTime: 212093913977/86400,-1/3,2299161>
@return [DateTime] Receiver
@api public
[Source]
# File lib/extlib/datetime.rb, line 24 24: def to_datetime 25: self 26: end
Convert to Time object (for DateTime/Time conversion protocol).
DateTime.now.to_time #=> Wed Nov 19 20:04:51 -0800 2008
@return [Time] Time object representing the same moment as receiver
# File lib/extlib/datetime.rb, line 12 12: def to_time 13: Time.parse self.to_s 14: end
[Validate]