class Cequel::Type::Timestamp

`timestamp` columns store timestamps. Timestamps do not include time zone data, and all input times are cast to UTC and rounded to the nearest millisecond before being stored.

@see cassandra.apache.org/doc/cql3/CQL.html#usingdates

CQL3 documentation for date columns

Public Instance Methods

cast(value) click to toggle source
# File lib/cequel/type.rb, line 393
def cast(value)
  if value.is_a?(::String) then Time.parse(value)
  elsif value.respond_to?(:to_time) then value.to_time
  elsif value.is_a?(Numeric) then Time.at(value)
  else Time.parse(value.to_s)
  end.utc.round(3)
end
internal_names() click to toggle source
# File lib/cequel/type.rb, line 388
def internal_names
  ['org.apache.cassandra.db.marshal.DateType',
   'org.apache.cassandra.db.marshal.TimestampType']
end