method

to_time

ruby latest stable - Class: XSD::XSDDateTimeImpl

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v1_8_7_330) is shown here.

to_time()
public

No documentation available.

# 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