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

# day

> Extracts the day part of a date or datetime expression and returns a value that ranges from 1 to 31.

Extracts the day part of a date or datetime expression and returns a value that ranges from 1 to 31.

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

## Syntax

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

## Examples

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

MySQL > select day('1987-01-31 20:10:59');
+----------------------------+
| day('1987-01-31 20:10:59') |
+----------------------------+
|                         31 |
+----------------------------+
```

## keywords

DAY, day


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