Timestamp type
A timestamp type can be entered as an integer for CQL input, or as a string literal in ISO 8601 formats.
yyyy-mm-dd HH:mm
yyyy-mm-dd HH:mm:ss
yyyy-mm-dd HH:mmZ
yyyy-mm-dd HH:mm:ssZ
yyyy-mm-dd'T'HH:mm
yyyy-mm-dd'T'HH:mmZ
yyyy-mm-dd'T'HH:mm:ss
yyyy-mm-dd'T'HH:mm:ssZ
yyyy-mm-dd
yyyy-mm-ddZ
where Z is the RFC-822 4-digit time zone, expressing the time zone's difference from UTC. For example, for the date and time of Feb 3, 2011, at 04:05:00 AM, GMT:
2011-02-03 04:05+0000
2011-02-03 04:05:00+0000
2011-02-03T04:05+0000
2011-02-03T04:05:00+0000
If no time zone is specified, the time zone of the Apache Cassandra™ coordinator node handing the write request is used. For accuracy, DataStax recommends specifying the time zone rather than relying on the time zone configured on the Cassandra nodes.
If you only want to capture date values, omit the time of day. For example:
2011-02-03
2011-02-03+0000
In this case, the time of day defaults to 00:00:00 in the specified or default time zone.
Timestamp output appears in the following format by default:yyyy-mm-dd HH:mm:ssZ
You can
change the format by setting the time_format
property in the
[ui]
section of the cqlshrc file.