A timestamp represents a specific moment in time. ScyllaDB uses TIMESTAMP for date-and-time values, storing a UTC-based instant as milliseconds since the Unix epoch. Separately, each non-primary-key cell receives a microsecond-precision write timestamp used for conflict resolution. section 4.3 section 6.1.2
Choose the timestamp-related representation that matches the requirement:
- Use TIMESTAMP when both the date and time identify the value; use DATE when only a date matters. section 4.3.3
- Use TIME for a time without a date and DURATION for a length of time. section 4.3
- Treat the latest write timestamp as decisive: ScyllaDB converges on the value with the highest timestamp, regardless of replica count. section 6.1.2
- Inspect a cell’s write timestamp with WRITETIME and override the query timestamp with USING TIMESTAMP. section 6.1.2
Concurrent author edits
Edith updates an author bio at QUORUM, then Emily writes a different bio at ONE milliseconds later. Emily’s higher timestamp wins and eventually replicates to all replicas. A deliberately old USING TIMESTAMP value, such as 1, cannot replace the newer bio. section 6.1.2
Table 4.6 Table times
|
Type
|
Stored as
|
Acceptable forms
|
|---|---|---|
TIMESTAMP
|
BIGINT representing the number of milliseconds since the Unix epoch (1970-01-01 00:00:00+0000)
|
1687654894759,
'2023-06-24 21:02:00+0000' and other ISO-8601 compliant timestamps
|
DATE
|
32-bit unsigned integer representing the number of days since the Unix epoch (1970-01-01), with the epoch in the center of the range (2^31)
|
'2023-06-24',
641
|
TIME
|
64-bit signed integer representing the number of nanoseconds since midnight
|
'21:07:12.123' with either second, millisecond, microsecond, or nanosecond precision,
76032123000
|
DURATION
|
Three integers representing the number of months, the number of days, and the number of nanoseconds
|
1y4mo3w5d3h6m19s400ms20us141ns or any combination of the units
|
Compare TIMESTAMP, DATE, TIME, and DURATION by stored representation and accepted input forms. section 4.3









