VeloDB Cloud
SQL Manual
Functions
date-time-functions
last_day

last_day

Description

Syntax:

DATE last_day(DATETIME date)

This function returns the last day of the month of the given date. In the returned result, the year and month will be the same as the input while the day can be one of the followings:

'28' (February of a non-leap year), '29' (February of a leap year), '30' (April, June, September, November), '31 '(January, March, May, July, August, October, December)

Example

mysql > select last_day('2000-02-03');
+-------------------+
| last_day('2000-02-03 00:00:00') |
+-------------------+
| 2000-02-29        |
+-------------------+

Keywords

LAST_DAY,DAYS