How to get last day of the current month in MySQL?


With the help of following MySQL query, we can get the last day of the current month −

mysql> SELECT LAST_DAY(now()) AS 'LAST DAY OF CURRENT MONTH';
+---------------------------+
| LAST DAY OF CURRENT MONTH |
+---------------------------+
| 2017-10-31                |
+---------------------------+
1 row in set (0.00 sec)

Updated on: 29-Jan-2020

296 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements