| Name | Aliases | Description |
|---|---|---|
DATE | calendar date (year, month day) |
A date specifies a combination of year, month and day. DuckDB follows the SQL standard's lead by counting dates exclusively in the Gregorian calendar, even for years before that calendar was in use. Dates can be created using the DATE keyword, where the data must be formatted according to the ISO 8601 format (YYYY-MM-DD).
SELECT DATE '1992-09-20';
There are also three special date values that can be used on input:
| Input string | Description |
|---|---|
| epoch | 1970-01-01 (Unix system day zero) |
| infinity | later than all other dates |
| -infinity | earlier than all other dates |
The values infinity and -infinity are specially represented inside the system and will be displayed unchanged; but epoch is simply a notational shorthand that will be converted to the date value when read.
SELECT
'-infinity'::DATE AS negative,
'epoch'::DATE AS epoch,
'infinity'::DATE AS positive; | negative | epoch | positive |
|---|---|---|
| -infinity | 1970-01-01 | infinity |
See Date Functions.
© Copyright 2018–2024 Stichting DuckDB Foundation
Licensed under the MIT License.
https://duckdb.org/docs/sql/data_types/date.html