method

to_time

Importance_0
v1_8_7_330 - Show latest stable - 0 notes - Class: XSD::XSDDateTimeImpl
to_time() public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/xsd/datatypes.rb, line 510
  def to_time
    begin
      if @data.offset * SecInDay == Time.now.utc_offset
        d = @data
        usec = (d.sec_fraction * SecInDay * 1000000).round
        Time.local(d.year, d.month, d.mday, d.hour, d.min, d.sec, usec)
      else
        d = @data.newof
        usec = (d.sec_fraction * SecInDay * 1000000).round
        Time.gm(d.year, d.month, d.mday, d.hour, d.min, d.sec, usec)
      end
    rescue ArgumentError
      nil
    end
  end
Register or log in to add new notes.