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

# dayofmonth

> 返回指定日期中的天数，取值范围 1 到 31。

获得日期中的天信息，返回值范围 1\~31。

参数为 DATE 或者 DATETIME 类型。

## 语法

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

## 示例

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


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