DAY() Function in MySQL
Last Updated :
02 Dec, 2020
Improve
DAY() 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 DAYOFMONTH() function.
Syntax :
DAY(date)Parameter : This method accepts a parameter which is illustrated below :
- date : Specified date to extract the day from.
SELECT DAY("2020-11-24");Output :
24Example-2 : Getting the day of the month from a specified date "2020-11-22 07:12:23".
SELECT DAY("2020-11-22 07:12:23");Output :
22Example-3 : Getting the day of the month for the current system date.
SELECT DAY(CURDATE());Output :
24Application : This function is used to return the day of the month for a specified date (a number from 1 to 31).