bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

MySQL LAST_DAY() Function

Concept visual

MySQL LAST_DAY() Function

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

Example

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

SELECT LAST_DAY("2017-06-20");

Definition and Usage

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

Syntax

LAST_DAY( date )

Parameter Values

Parameter

Description date

Required. The date to extract the last day of the month from

Technical Details

Works in:

From MySQL 4.0

More Examples

Example

Extract the last day of the month for the given date: SELECT LAST_DAY("2017-02-10 09:34:00");

Previous

❮ MySQL Functions

Next

Previous

MySQL HOUR() Function

Next

MySQL LOCALTIME() Function