WEEKDAY()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Xpand
Topics on this page:
Overview
Returns the week day index for a date.
USAGE
WEEKDAY(date)
Argument Name | Description |
---|---|
| The date to evaluate |
DETAILS
WEEKDAY()
is a date-time function that returns the weekday index for a date.
The return value begins with 0
for Monday and ends with 6
for Sunday.
A NULL
is returned if the argument is NULL
.
EXAMPLES
SELECT WEEKDAY('2020-02-01 23:59:59');
+--------------------------------+
| WEEKDAY('2020-02-01 23:59:59') |
+--------------------------------+
| 5 |
+--------------------------------+
SELECT WEEKDAY('2020-02-01');
+-----------------------+
| WEEKDAY('2020-02-01') |
+-----------------------+
| 5 |
+-----------------------+