Home  >  Article  >  Database  >  How to get the date of the last day of the month in MySQL

How to get the date of the last day of the month in MySQL

WBOY
WBOYforward
2023-06-03 14:33:371280browse

LAST_DAY(date): Get the date of the last day of the month on date

SELECT LAST_DAY(SYSDATE()) 
SELECT LAST_DAY(‘2015-02-02') 
SELECT LAST_DAY(‘2015-02-02 00:22:33')
-> 2016-01-31
-> 2015-02-28
-> 2015-02-28

The above is the detailed content of How to get the date of the last day of the month in MySQL. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete