Use of DAYOFWEEK() function in MySQL Last Updated : 10 Dec, 2020 Comments Improve Suggest changes Like Article Like Report DAYOFWEEK() : This function in MySQL helps to return weekday numbers/index from the given date(a number from 1 to 7). The weekday index returned by DAYOFWEEK() function follows ODBC standards. Note - Following are the weekday numbers. Sunday Monday Tuesday Wednesday Thursday Friday Saturday Syntax : DAYOFWEEK(date) Parameters : The function accepts only one argument. date - A DATE or DATETIME from which weekday index is returned Returns : The function will return weekday numbers/index from the given date(a number from 1 to 7). If the date is zero (0000-00-00) or invalid, in that case, the function will return NULL. Example-1 : Obtaining the day of the week from a specific date “2020-09-13”. SELECT DAYOFWEEK("2020-09-13") AS WEEKDAY; Output : WEEKDAY1 Example-2 : Obtaining the day of the week from a specific DateTime "2000-11-27 07:12:23". SELECT DAYOFWEEK("2000-11-02 07:12:23") AS WEEKDAY; Output : WEEKDAY5 Example-3 : Obtaining the day of the week for the current system date i.e using CURDATE() function SELECT DAYOFWEEK(CURDATE()) AS WEEKDAY; Output : WEEKDAY4 Comment More infoAdvertise with us Next Article Use of DAYOFWEEK() function in MySQL V vanshgaur14866 Follow Improve Article Tags : Technical Scripter SQL Technical Scripter 2020 DBMS-SQL mysql +1 More Similar Reads DAYOFWEEK() Function in MySQL DAYOFWEEK() function : This function in MySQL is used to return the weekday index for a specified date (a number from 1 to 7). Note : 1=Sunday, 2=Monday, 3=Tuesday, 4=Wednesday, 5=Thursday, 6=Friday, 7=Saturday. Syntax : DAYOFWEEK(date) Parameter : This method accepts a parameter which is illustrate 1 min read DAYOFYEAR() Function in MySQL DAYOFYEAR() function: This function in MySQL is used to return the day of the year for a specified date (a number from 1 to 366). Syntax : DAYOFYEAR(date) Parameter : This method accepts a parameter which is illustrated below: date: Specified date to return the day of the year from Returns : It retu 1 min read TO DAYS() FUNCTION in MySQL TO DAYS() : TO DAYS() function in MySQL takes the given date and returns a number of days since year 0 corresponding to the given date.TO DAYS() function can only be used with the dates within the Gregorian calendar. Syntax : TO DAYS(date) Parameters: The function can accept only one argument as sho 1 min read DAY() Function in MySQL 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 th 1 min read 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. date - Specified date to extract the weekday name from Returns : It returns the weekday name 1 min read Like