WEEKDAY
WEEKDAY(date)
Section titled “WEEKDAY(date)”- date: The date or datetime value from which the day of the week is to be extracted. The accepted format is ‘YYYY-MM-DD’ or ‘YYYY-MM-DD HH
Example
Section titled “Example”SELECT WEEKDAY('2022-03-12');Output
Section titled “Output”5Explanation
Section titled “Explanation”The WEEKDAY function in MySQL returns the index of the weekday (0 = Monday, 1 = Tuesday, … 6 = Sunday). In the provided example, ‘2022-03-12’ falls on a Saturday hence, the output is 5.