Class: DateTime

Inherits:
Object show all
Defined in:
lib/extlib/datetime.rb

Instance Method Summary collapse

Instance Method Details

#to_datetimeDateTime

Return receiver (for DateTime/Time conversion protocol).

DateTime.now.to_datetime    #=> #<DateTime: 212093913977/86400,-1/3,2299161>

Returns:



25
# File 'lib/extlib/datetime.rb', line 25

remove_method :to_datetime

#to_timeTime

Convert to Time object (for DateTime/Time conversion protocol).

DateTime.now.to_time    #=> Wed Nov 19 20:04:51 -0800 2008

Returns:

  • (Time)

    Time object representing the same moment as receiver



12
# File 'lib/extlib/datetime.rb', line 12

remove_method :to_time