Definition:
The Oracle PL/SQL LAST_DAY function returns the last day of the month extracted from the provided date value argument. It accepts argument of DATE type and returns argument of DATE type. The LAST_DAY function is often used to determine leap years by checking the month of February for that year to see if it had the extra day present in a leap year.
Example Syntax:
LAST_DAY (date);
Example Usage:
This example finds the last day in February, 2004. It returns '29' for the date because 2004 was a leap year.
SELECT LAST_DAY('16-FEB-2004') Last_Day
FROM DUAL;
LAST_DAY
---------------
29-FEB-04
Related Links:
Related Code Snippets:
- Last_Day function - The last_day function returns the last day of the month based on a date value.
