Date and time data types

Exasol supports the DATE and TIMESTAMP(p) data types from the SQL standard. Additionally, TIMESTAMP(p) WITH LOCAL TIME ZONE can be used to handle timestamps in the session time zone.

For the TIMESTAMP data types, p is the fractional seconds precision which defines the number of fractional digits that can be stored for the second of the timestamp. For example, TIMESTAMP(4) can be used to store the timestamp 2024-01-31 00:00:00.1234.

Commonly used fractional seconds precisions are:

In Exasol versions before 8.32.0 the maximum precision is 3 (millisecond).

Data type Range Note

DATE

0001-01-01 to 9999-12-31

 

TIMESTAMP(p)

0001-01-01 00:00:00.000000000 to 9999-12-31 23:59:59.999999999

Timestamp without time zone.

p = fractional seconds precision (optional)

0 ≤ p ≤ 9, default = 3

Note: In Exasol versions before 8.32.0 the maximum precision is 3.

TIMESTAMP(p) WITH LOCAL TIME ZONE

0001-01-01 00:00:00.000000000 to 9999-12-31 23:59:59.999999999

Timestamp considering the session time zone.

If the session time zone is not set to UTC, the usable range is slightly smaller because all timestamps must be within this range in both the session time zone and UTC.

p = fractional seconds precision (optional)

0 ≤ p ≤ 9, default = 3

Note: In Exasol versions before 8.32.0 the maximum precision is 3.