ID EN
Date and Time Functions

DAYOFWEEK(date)

MySQL 8.4

Returns the weekday index for date (1 = Sunday, 2 = Monday, …, 7 = Saturday). These index values correspond to the ODBC standard. Returns NULL if date is NULL.

Syntax

MYSQL
SELECT DAYOFWEEK('2007-02-03');
7

Examples

Example
MYSQL
SELECT DAYOFWEEK('2007-02-03');
7