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

# year

> Returns the year part in a date and returns a value that ranges from 1000 to 9999.

Returns the year part in a date and returns a value that ranges from 1000 to 9999.

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

## Syntax

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

## Examples

```Plain Text theme={null}
MySQL > select year('1987-01-01');
+-----------------------------+
| year('1987-01-01 00:00:00') |
+-----------------------------+
|                        1987 |
+-----------------------------+
```

## keyword

YEAR


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