Skip to content

Time64 ​

Time64(P) represents signed seconds with P fractional digits, without a calendar date or timezone. Values can be negative and can exceed 24 hours.

Syntax ​

text
Time64
Time64(P)
  • P — Fractional-second precision from 0 through 9. The default is 3.

Input and conversion ​

Numeric input is always seconds, including integer input. This differs from DateTime64, whose integer input is ticks. Clock text can include a sign and a fractional part; excess fraction digits are truncated to the declared precision.

The value must fit signed 64-bit ticks. Displayed clock components saturate at 999:59:59 plus the declared fraction, while arithmetic and numeric casts retain the underlying value. Timezone arguments are not accepted.

Adding a Time64 to a Date produces a UTC timestamp. Numeric operations consume seconds, including the fraction. Cast to Decimal when an aggregate must preserve an exact fixed-scale total.

Examples ​

Seconds and fractional text ​

sql
SELECT CAST(3723 AS Time64(3)),
       CAST('-01:02:03.123' AS Time64(3))
FORMAT csv;
text
"01:02:03.000","-01:02:03.123"

Reading an exact numeric duration ​

sql
SELECT CAST(CAST('01:02:03.125' AS Time64(3)) AS Decimal(18, 3))
FORMAT csv;
text
3723.125

Truncating fractional digits ​

sql
SELECT CAST('00:00:01.123456' AS Time64(3))
FORMAT csv;
text
"00:00:01.123"