Open In App

DAYNAME() Function in MySQL

DAYNAME() function :
This function in MySQL is used to return the weekday name for a specified date.

Syntax :



DAYNAME(date)

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

Returns :
It returns the weekday name for a specified date.



Example-1 :
Getting the weekday name for a specified date. “2020-11-24”.

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

Output :

Tuesday

Example-2 :
Getting the weekday name from a specified date “2020-11-22 07:12:23”.

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

Output :

Sunday

Example-3 :
Getting the weekday name for the current system date.

SELECT DAYNAME(CURDATE());

Output :

Tuesday

Application :
This function is used to return the weekday name for a specified date.

Article Tags :
SQL