DATE (calendar date)
Last updated: 2026-11-04
DATE (calendar date)
DATE represents a calendar date with no time and no time zone, ranging from 4713 BC to 5874897 AD and stored as a 4-byte Julian day count. Arithmetic reads naturally: date + 7 yields the date a week later, and date - date yields the number of days between them. Because it carries no time-of-day, DATE cannot express "a moment on a given day"; it fits birthdays and billing dates, while actual event instants belong in TIMESTAMP.
| Kind | type |
|---|---|
| Example Language | SQL |
📝 Syntax
DATE —— calendar date, 4 bytes, 4713 BC to 5874897 AD
Returns:Stores a calendar date. Adding an integer yields a shifted date, subtracting two DATEs yields an integer number of days, and subtracting a TIMESTAMP yields a full interval.
▶ Example
Runs real PostgreSQL 18 right in your browser (PGlite WASM, nothing to install). Press ▶ Run and the result appears in the panel below.
Output:
id | born_on | plus_30_days | days_since_2024 | col_type
----+------------+--------------+-----------------+----------
1 | 1990-05-20 | 1990-06-19 | -12279 | date
2 | 2024-02-29 | 2024-03-30 | 59 | date
📌 Key Points
- 2024-02-29 is a leap day, and PostgreSQL handles leap years and leap-second rules correctly.
- date + 30 returns a DATE, and date - date returns an integer count of days rather than an INTERVAL.
- DATE carries no time zone at all, so the same calendar day can correspond to different absolute instants across zones. Events that actually happened belong with TIMESTAMPTZ.