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

# hour

> Returns the hour for a given date.

Returns the hour for a given date. The return value ranges from 0 to 23.

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

## Syntax

```Haskell theme={null}
INT HOUR(DATETIME|DATE date)
```

## Examples

```Plain Text theme={null}
MySQL > select hour('2018-12-31 23:59:59');
+-----------------------------+
| hour('2018-12-31 23:59:59') |
+-----------------------------+
|                          23 |
+-----------------------------+
```

## keyword

HOUR


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