scalar

AGE

Computes a symbolic interval using calendar years and months rather than only elapsed seconds. Example target: PostgreSQL 17. No tables or extensions required.

Formal Syntax & Structure

sql syntaxsql
AGE(end_timestamp,start_timestamp)

Working Example

Example Snippetsql
SELECT age(TIMESTAMP '2024-03-01', TIMESTAMP '2024-02-01')::text;
SQL Reference