date()
SQLite functions that do calendar arithmetic and formatting on dates stored as year-month-day text.
In more detail
date('2024-03-01', '+45 days') returns 2024-04-15, counting month lengths correctly, and strftime('%Y', joined) pulls out the year. They only work if the text is in the year-month-day layout.
Example
SELECT date('2024-03-01', '+45 days');Related terms
- ISO 8601 date format — The international standard for writing dates and times as text, such as 2024-01-15T10:00:00Z.
- DATE — A PostgreSQL column type that holds a calendar date, validates it, sorts it and supports date arithmetic.
Taught in
- Data Types And What To Choose — PostgreSQL, Indexing & Relational Data Modeling