DATE
A PostgreSQL column type that holds a calendar date, validates it, sorts it and supports date arithmetic.
In more detail
A DATE column cannot hold the thirty-first of February, and subtracting two dates gives an interval. SQLite has no date type, so the course stores dates as year-month-day text and uses SQLite's date functions on it.
Example
added_on DATE NOT NULL DEFAULT CURRENT_DATERelated terms
- ISO 8601 date format — The international standard for writing dates and times as text, such as 2024-01-15T10:00:00Z.
- date() — SQLite functions that do calendar arithmetic and formatting on dates stored as year-month-day text.
- data type — The kind of a value, such as a whole number, text or a date, which decides what you can do with it and how it compares and sorts.
Taught in
- Data Types And What To Choose — PostgreSQL, Indexing & Relational Data Modeling