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.
| Type | Format | Lower bound | Upper bound | Description |
|---|---|---|---|---|
DATETIME | YYYY-MM-DD HH:MM:SS[.fraction] | 0000-00-00 00:00:00.000000 | 9999-12-31 23:59:59.999999 | Date and time (not considering time zone) |
TIMESTAMP | YYYY-MM-DD HH:MM:SS[.fraction] | 0000-00-00 00:00:00.000000 | 9999-12-31 23:59:59.999999 | Date and time (considering time zone) |
DATE | YYYY-MM-DD | 0000-00-00 | 9999-12-31 | Date |
TIME | HH:MM:SS[.fraction] | -838:59:59.000000 | 838:59:59.000000 | Time |
YEAR | YYYY | 1901 | 2155 | Year |
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.