Time64
Data type Time64
represents a time-of-day with fractional seconds.
It has no calendar date components (day, month, year).
The precision
parameter defines the number of fractional digits and therefore the tick size.
Tick size (precision): 10-precision seconds. Valid range: 0..9. Common choices are 3 (milliseconds), 6 (microseconds), and 9 (nanoseconds).
Syntax:
Internally, Time64
stores a signed 64-bit decimal (Decimal64) number of fractional seconds.
The tick resolution is determined by the precision
parameter.
Time zones are not supported: specifying a time zone with Time64
will throw an error.
Unlike DateTime64
, Time64
does not store a date component.
See also Time
.
Text representation range: [-999:59:59.000, 999:59:59.999] for precision = 3
. In general, the minimum is -999:59:59
and the maximum is 999:59:59
with up to precision
fractional digits (for precision = 9
, the minimum is -999:59:59.999999999
).
Implementation details
Representation.
Signed Decimal64
value counting fractional second with precision
fractional digits.
Normalization.
When parsing strings to Time64
, the time components are normalized and not validated.
For example, 25:70:70
is interpreted as 26:11:10
.
Negative values.
Leading minus signs are supported and preserved.
Negative values typically arise from arithmetic operations on Time64
values.
For Time64
, negative inputs are preserved for both text (e.g., '-01:02:03.123'
) and numeric inputs (e.g., -3723.123
).
Saturation. The time-of-day component is capped to the range [-999:59:59.xxx, 999:59:59.xxx] when converting to components or serialising to text. The stored numeric value may exceed this range; however, any component extraction (hours, minutes, seconds) and textual representation use the saturated value.
Time zones.
Time64
does not support time zones.
Specifying a time zone when creating a Time64
type or value throws an error.
Likewise, attempts to apply or change the time zone on Time64
columns is not supported and results in an error.
Examples
- Creating a table with a
Time64
-type column and inserting data into it:
- Filtering on
Time64
values
Note: toTime64
parses numeric literals as seconds with a fractional part according to the specified precision, so provide the intended fractional digits explicitly.
- Inspecting the resulting type:
See Also
- Type conversion functions
- Functions for working with dates and times
- The
date_time_input_format
setting - The
date_time_output_format
setting - The
timezone
server configuration parameter - The
session_timezone
setting - Operators for working with dates and times
Date
data typeTime
data typeDateTime
data type