Parent

Time

Public Instance Methods

to_datetime() click to toggle source
    # File lib/extlib/time.rb, line 41
41:   def to_datetime
42:     DateTime.new(year, month, day, hour, min, sec, Rational(gmt_offset, 24 * 3600))
43:   end
to_datetime click to toggle source

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

  Time.now.to_datetime    #=> #<DateTime: 106046956823/43200,-1/3,2299161>

@return [DateTime] DateTime object representing the same moment as receiver

@api public

    # File lib/extlib/time.rb, line 40
40:   remove_method :to_datetime if instance_methods(false).any? { |m| m.to_sym == :to_datetime }
to_json(*) click to toggle source

Convert to ISO 8601 representation

  Time.now.to_json        #=> "\"2008-03-28T17:54:20-05:00\""

@return [String]

  ISO 8601 compatible representation of the Time object.

@api public

    # File lib/extlib/time.rb, line 15
15:   def to_json(*)
16:     self.xmlschema.to_json
17:   end
to_time click to toggle source

Return receiver (for DateTime/Time conversion protocol).

  Time.now.to_time        #=> Wed Nov 19 20:08:28 -0800 2008

@return [Time] Receiver

@api public

    # File lib/extlib/time.rb, line 27
27:   remove_method :to_time if instance_methods(false).any? { |m| m.to_sym == :to_time }
to_time() click to toggle source
    # File lib/extlib/time.rb, line 28
28:   def to_time
29:     self
30:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.