Returns the last day of the month for a given date.
DATEDiperbarui: 13 Jun 2026LAST_DAY(date)The reference date
1 SELECT LAST_DAY('2024-02-15') AS last_day;
The last day of February 2024 (a leap year).
1 SELECT LAST_DAY(CURDATE()) AS month_end;
Returns the last day of the current month.
1 SELECT DATE_FORMAT(order_date, '%Y-%m-01') AS month_start, 2 LAST_DAY(order_date) AS month_end, 3 COUNT(*) AS orders 4 FROM orders 5 GROUP BY DATE_FORMAT(order_date, '%Y-%m');
Builds date ranges for monthly reporting.
Sudah paham LAST_DAY? Latih langsung di browser
Latihan interaktif, langsung di browser.