Skip to main content

Overview of date and time types

seekdb supports date and time data types for representing time values, including DATE, TIME, DATETIME, TIMESTAMP, and YEAR. Each type has a valid value range and a "zero" value, which can be specified for invalid values that cannot be represented.

The following table lists the date and time types supported in the current version of seekdb and related information.

TypeFormatLower boundUpper boundDescription
DATETIMEYYYY-MM-DD HH:MM:SS[.fraction]0000-00-00 00:00:00.0000009999-12-31 23:59:59.999999Date and time (not considering time zone)
TIMESTAMPYYYY-MM-DD HH:MM:SS[.fraction]0000-00-00 00:00:00.0000009999-12-31 23:59:59.999999Date and time (considering time zone)
DATEYYYY-MM-DD0000-00-009999-12-31Date
TIMEHH:MM:SS[.fraction]-838:59:59.000000838:59:59.000000Time
YEARYYYY19012155Year

The value range and precision of DATETIME, TIMESTAMP, and TIME depend on the Scale attribute. The Scale attribute specifies the maximum number of valid decimal places, with a maximum value of 6 and a default value of 0.