THE WORLD'S LARGEST WEB DEVELOPER SITE

MySQL LAST_DAY() Function

❮ MySQL Functions

Example

Return the last day of the month for the given date:

SELECT LAST_DAY("2017-06-20");
Try it Yourself »

Definition and Usage

The LAST_DAY() function returns the last day of the month for a given date.

Syntax

LAST_DAY(date)

Parameter Values

Parameter Description
date Required. The date or datetime value from which to extract the last day of the month

Technical Details

Works in: MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1.1

More Examples

Example

Return the last day of the month for the given date:

SELECT LAST_DAY("2017-02-10 09:34:00");
Try it Yourself »

❮ MySQL Functions