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

# dayofmonth

> Obtains the day part in a date and returns a value that ranges from 1 to 31.

Obtains the day part in a date 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 DAYOFMONTH(DATETIME date)
```

## Examples

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

## keyword

DAYOFMONTH


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