Class: Time

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

Instance Method Summary collapse

Instance Method Details

#to_datetimeObject


41
42
43
# File 'lib/extlib/time.rb', line 41

def to_datetime
  DateTime.new(year, month, day, hour, min, sec, Rational(gmt_offset, 24 * 3600))
end

#to_jsonString

Convert to ISO 8601 representation

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

15
16
17
# File 'lib/extlib/time.rb', line 15

def to_json(*)
  self.xmlschema.to_json
end

#to_timeObject


28
29
30
# File 'lib/extlib/time.rb', line 28

def to_time
  self
end