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. Also, read about the MySQL DAY function.

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

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

16

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

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

TIP: Please refer to the MySQL DAYOFYEAR and MySQL MONTH functions from the list of available MySQL Date functions.