Skip to content
Related Articles

Related Articles

Improve Article

DAYOFMONTH() Function in MySQL

  • Last Updated : 27 Nov, 2020
Geek Week

DAYOFMONTH() function :
This function in MySQL is used to return the day of the month for a specified date (a number from 1 to 31). This function equals the DAY() function.

Syntax :

DAYOFMONTH(date)

Parameter :
This method accepts a parameter which is illustrated below as follows.

  • date – Specified date to extract the day from.

Returns :
It returns the day of the month for a specified date (a number from 1 to 31).

Example-1 :
Getting the day of the month from a specified date “2020-11-24”.



SELECT DAYOFMONTH("2020-11-24");  

Output :

24

Example-2 :
Getting the day of the month from a specified date “2020-11-22 07:12:23”.

SELECT DAYOFMONTH("2020-11-22 07:12:23");  

Output :

22

Example-3 :
Getting the day of the month for the current system date.

SELECT DAYOFMONTH(CURDATE());

Output :

24

Application :
This function is used to return the day of the month for a specified date (a number from 1 to 31).

Attention reader! Don’t stop learning now. Learn SQL for interviews using SQL Course  by GeeksforGeeks.

My Personal Notes arrow_drop_up
Recommended Articles
Page :