Purpose
This function returns the date of the last day of the month in which the date value falls.
Syntax
LAST_DAY (date)
Parameters
Parameter |
Description |
|---|---|
| date | A value of any date data type (DATE, TIMESTAMP, TIMESTAMP WITH TIME ZONE, or TIMESTAMP WITH LOCAL TIME ZONE). |
Return type
DATE
Examples
Display the current date, the date of the last day of the current month, and the number of remaining days in the current month.
obclient> SELECT SYSDATE,LAST_DAY(SYSDATE) "Last",LAST_DAY(SYSDATE)-SYSDATE FROM DUAL;
+-----------+-----------+---------------------------+
| SYSDATE | Last | LAST_DAY(SYSDATE)-SYSDATE |
+-----------+-----------+---------------------------+
| 17-NOV-21 | 30-NOV-21 | 13 |
+-----------+-----------+---------------------------+
1 row in set
