Skip to content

LAST_DAY

Return the last day of the month, based on a given date or timestamp.

LAST_DAY | EOMONTH ( date | timestamp | timestamptz )

EOMONTH is a synonym for LAST_DAY. For example:

premdb=# select last_day(current_date) from sys.const;
  last_day  
------------
 2017-11-30
(1 row)

premdb=# select eomonth(current_date) from sys.const;
  eomonth   
------------
 2017-11-30
(1 row)
premdb=# select distinct last_day(matchday) 
from match where seasonid=22 order by 1;
  last_day  
------------
 2013-08-31
 2013-09-30
 2013-10-31
 2013-11-30
 2013-12-31
 2014-01-31
 2014-02-28
 2014-03-31
 2014-04-30
 2014-05-31
(10 rows)