class DBF::ColumnType::DateTime

Public Instance Methods

type_cast(value) click to toggle source

@param value [String]

# File lib/dbf/column_type.rb, line 85
def type_cast(value)
  days, msecs = value.unpack('l2')
  secs = (msecs / 1000).to_i
  ::DateTime.jd(days, (secs / 3600).to_i, (secs / 60).to_i % 60, secs % 60).to_time
rescue StandardError
  nil
end