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

# weekofyear

> 计算指定时间为一年中的第几周。

计算指定时间为一年中的第几周。

## 语法

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

## 参数说明

参数为 DATE 或者 DATETIME 类型。

## 返回值说明

返回 INT 类型的值。

## 示例

```Plain Text theme={null}
select weekofyear('2008-02-20 00:00:00');
+-----------------------------------+
| weekofyear('2008-02-20 00:00:00') |
+-----------------------------------+
|                                 8 |
+-----------------------------------+
```


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