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

# weekofyear

> Returns the week number for a given date within a year.

Returns the week number for a given date within a year.

The `date` parameter must be of the DATE or DATETIME type.

## Syntax

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

## Examples

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

## keyword

WEEKOFYEAR


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