Timestamp

Date and time can be stored using the timestamp type, which holds date/time data with millisecond precision. Timestamp literals are enclosed in single quotation marks like string literals, and they take the yyyy-mm-dd HH:mm:ssZ format, for example 2014-05-18 15:49:31-0400. There is no type that stores the date without the time, although the time portion of a timestamp literal can be omitted, which defaults the time to midnight in the given time zone. To represent timestamps with millisecond precision, you may also use an integer literal with the number of milliseconds since midnight UTC on January 1, 1970, for instance 1,400,442,761,830.

Get Learning Apache Cassandra - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.