Class: Time
Instance Method Summary collapse
-
#to_datetime ⇒ DateTime
Convert to DateTime (for DateTime/Time conversion protocol).
-
#to_json ⇒ String
Convert to ISO 8601 representation.
-
#to_time ⇒ Time
Return receiver (for DateTime/Time conversion protocol).
Instance Method Details
#to_datetime ⇒ DateTime
Convert to DateTime (for DateTime/Time conversion protocol).
Time.now.to_datetime #=> #<DateTime: 106046956823/43200,-1/3,2299161>
39 |
# File 'lib/extlib/time.rb', line 39 remove_method :to_datetime |
#to_json ⇒ String
Convert to ISO 8601 representation
Time.now.to_json #=> "\"2008-03-28T17:54:20-05:00\""
14 15 16 |
# File 'lib/extlib/time.rb', line 14 def to_json(*) self.xmlschema.to_json end |
#to_time ⇒ Time
Return receiver (for DateTime/Time conversion protocol).
Time.now.to_time #=> Wed Nov 19 20:08:28 -0800 2008
26 |
# File 'lib/extlib/time.rb', line 26 remove_method :to_time |