MySQL WEEKDAY() Function
Definition and Usage
The WEEKDAY() function returns the weekday number for a given date.
Note: 0 = Monday, 1 = Tuesday, 2 = Wednesday, 3 = Thursday, 4 = Friday, 5 = Saturday, 6 = Sunday.
Syntax
WEEKDAY(date)
Parameter Values
Parameter | Description |
---|---|
date | Required. The date or datetime to extract the weekday number from |
Technical Details
Works in: | From MySQL 4.0 |
---|
More Examples
Example
Return the weekday number for the current system date:
SELECT WEEKDAY(CURDATE());
Try it Yourself »
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.