# File lib/ole/types/base.rb, line 67 def self.load str low, high = str.to_s.unpack 'V2' # we ignore these, without even warning about it return nil if low == 0 and high == 0 # switched to rational, and fixed the off by 1 second error i sometimes got. # time = EPOCH + (high * (1 << 32) + low) / 1e7 / 86400 rescue return # use const_get to ensure we can return anything which subclasses this (VT_DATE?) const_get('EPOCH') + Rational(high * (1 << 32) + low, 1e7.to_i * 86400) rescue return # extra sanity check... #unless (1800...2100) === time.year # Log.warn "ignoring unlikely time value #{time.to_s}" # return nil #end #time end