> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# weekday

> 返回指定日期的工作日索引值，星期一为0，星期日为6。

返回指定日期的工作日索引值，即星期一为 0，星期日为 6。

## 语法

```Haskell theme={null}
INT WEEKDAY(DATETIME date)
```

## 参数说明

`date`：参数为 DATE 或 DATETIME 类型，或者为可以 CAST 成 DATE 或 DATETIME 类型的数字。

## 示例

```SQL theme={null}
MySQL > select weekday('2023-01-01');
+-----------------------+
| weekday('2023-01-01') |
+-----------------------+
|                     6 |
+-----------------------+
```

## 关键字

WEEKDAY


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.