Skip to content

DAYOFMONTH

  • date: The date or datetime from which to extract the day of the month. This parameter should be in ‘YYYY-MM-DD’ or ‘YYYY-MM-DD HH
SELECT DAYOFMONTH('2022-07-18') AS 'Day of the Month';
+------------------+
| Day of the Month |
+------------------+
| 18 |
+------------------+

The DAYOFMONTH function in MySQL is used to return the day of the month for a specified date. The date is passed as an argument in the format ‘YYYY-MM-DD’. In the given example, ‘2022-07-18’ is the input date, and the function DAYOFMONTH returns ‘18’ as the day of the month.