AGE returns an INTERVAL value representing the difference between two TIMESTAMP values.
Syntax
AGE ( expression1 [ , expression2 ] )
Semantics
expression1 |
(TIMESTAMP) specifies the beginning of the INTERVAL |
expression2 |
(TIMESTAMP) specifies the end of the INTERVAL. The default is the CURRENT_DATE |
Examples
> SELECT AGE(TIMESTAMP '2001-04-10', TIMESTAMP '1957-06-13');
age
-------------------------
43 years 9 mons 27 days
(1 row)
> SELECT AGE(TIMESTAMP '1957-06-13');
age
-------------------------
50 years 4 mons 13 days
(1 row)