Skip to content
Related Articles

Related Articles

Improve Article

DAYNAME() Function in MySQL

  • Difficulty Level : Easy
  • Last Updated : 27 Nov, 2020
Geek Week

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.

  • date – Specified date to extract the weekday name from

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.

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 :