Class: ADT::ColumnType::DateTime

Inherits:
Base
  • Object
show all
Defined in:
lib/adt/column_type.rb

Instance Method Summary collapse

Instance Method Details

#flagObject



95
96
97
# File 'lib/adt/column_type.rb', line 95

def flag
  '?'
end

#type_cast(value, _table) ⇒ Object



89
90
91
92
93
# File 'lib/adt/column_type.rb', line 89

def type_cast(value, _table)
  val = value.unpack('L L')
  date = ::Date.jd(val.dig(0))
  ::Time.at(date.to_time + val.dig(1) / 1000).to_datetime
end