Date32
Date32 represents a Gregorian calendar date without a time of day or timezone. Its supported range is 1900-01-01 through 2299-12-31, inclusive.
Syntax
Date32Input and conversion
Text input uses YYYY-MM-DD and must be a valid date within the supported range. Integer input is the number of days since 1970-01-01 and can be negative for earlier dates.
Casting a date to INTEGER returns its epoch-day count. Adding or subtracting an integer moves the date by that many days. Use an Interval for calendar-month or year arithmetic.
A Date compared with a timestamp represents midnight in the timestamp's timezone. Native date values cannot be summed directly; convert them explicitly when a numeric calculation is intended.
Examples
Creating a date column
CREATE TABLE events(id UInt32, day Date32);
INSERT INTO events VALUES (1, '2100-01-01');SELECT id, day, day + 1 AS next_day
FROM events
FORMAT csv;1,"2100-01-01","2100-01-02"Converting epoch days
SELECT CAST(1 AS Date32),
CAST(CAST('1970-01-02' AS Date32) AS INTEGER)
FORMAT csv;"1970-01-02",1See Date for the alternative date range, and DateTime for whole-second timestamps.