MySQL DAYOFMONTH

MySQL DAYOFMONTH is one of the Date Functions, which returns the Day Number of the given date or an expression. The syntax of the Day Of Month is as shown below:

DAYOFMONTH(Date);

MySQL DAYOFMONTH Example

The following query shows you the use of this day of Month method. First, we used the date expression inside this DAYOFMONTH function. Next, we used the Date and Time expression. Both these statements return the Day number from the given dates.

SELECT DAYOFMONTH('2018-11-04');

SELECT DAYOFMONTH('2017-09-16 01:14:22');
4

16

In this Date method example, we are using the NOW(), and CURTIME() functions inside this DAYOFMONTH. The above MySQL screenshot displays today’s day number.

SELECT DAYOFMONTH(NOW()), DAYOFMONTH(CURTIME());
MySQL DAYOFMONTH Function Example