weekday
Returns the weekday index for a given date. For example, the index for Monday is 0, for Sunday is 6.
Syntaxβ
INT WEEKDAY(DATETIME date)
Parametersβ
date: The date parameter must be of the DATE or DATETIME type, or a valid expression that can be cast into a DATE or DATETIME value.
Examplesβ
MySQL > select weekday('2023-01-01');
+-----------------------+
| weekday('2023-01-01') |
+-----------------------+
| 6 |
+-----------------------+
keywordβ
WEEKDAY