method
to_time
v1_8_6_287 -
Show latest stable
- Class:
XSD::XSDDateTimeImpl
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