Retrieve the weekday index for a specified date.
| SELECT WEEKDAY(“2017-06-15”); |
The WEEKDAY() function returns the weekday index for a provided date.
Note: 0 = Monday, 1 = Tuesday, 2 = Wednesday, 3 = Thursday, 4 = Friday, 5 = Saturday, 6 = Sunday.
| WEEKDAY(date) |
|
Parameter |
Description |
|
date |
Required: The date or datetime from which to extract the weekday index. |
|
Works in: |
From MySQL version 4.0 |
Retrieve the numerical representation of the weekday for a given date.
| SELECT WEEKDAY(“2017-01-01”); |
Retrieve the numerical representation of the weekday for the current system date.
| SELECT WEEKDAY(CURDATE()); |