Appearance
CURRENT_DATE
Return the date when the current transaction starts. This value does not change during the course of a transaction and does not reflect the individual start dates of statements within a transaction.
You can use the result of this function to calculate intervals between the current date and other datetime values in the database. For example:
premdb=# select CURRENT_DATE, matchday, CURRENT_DATE-matchday numdays
FROM match WHERE seasonid=20 LIMIT 2;
date | matchday | numdays
------------+---------------------+-----------
2016-05-20 | 2012-03-24 00:00:00 | 1518 days
2016-05-20 | 2012-02-04 00:00:00 | 1567 days
(2 rows)
Parent topic:Datetime Functions