---
title: "DAYOFMONTH - OceanBase 数据库 V4.2.2 | OceanBase 文档中心"
description: "DAYOFMONTH 声明 DAYOFMONTH(date) 说明 返回日期或时间日期 date 在一个月中的位置。 示例 obclient&gt; SELECT DAYOFMONTH(&#x27;2008-12-31&#x27;); +--------------------------+ | DAYOFMONTH(&#x27;2008-12-31&#x27;…"
---
切换语言

- 中文站 - 简体中文
- International - English
- 日本站 - 日本語

文档反馈![](https://mdn.alipayobjects.com/huamei_22khvb/afts/img/A*P8CuR4UJ_FkAAAAAAAAAAAAADiGDAQ/original) OceanBase 数据库分布式版 - V 4.2.2

# DAYOFMONTH

更新时间：2026-04-10 11:58:36

[编辑](https://github.com/oceanbase/oceanbase-doc/edit/V4.2.2/zh-CN/700.reference/500.sql-reference/100.sql-syntax/200.common-tenant-of-mysql-mode/400.functions-of-mysql-mode/200.single-row-functions-of-mysql-mode/100.date-and-time-functions-of-mysql-mode/1300.dayofmonth-of-mysql-mode.md)  

## 声明

```sql
DAYOFMONTH(date)

```

## 说明

返回日期或时间日期 `date` 在一个月中的位置。

## 示例

```sql
obclient> SELECT DAYOFMONTH('2008-12-31');
+--------------------------+
| DAYOFMONTH('2008-12-31') |
+--------------------------+
|                       31 |
+--------------------------+

```

 上一篇 下一篇 ![有帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*y6ocSqN8cqsAAAAAAAAAAAAAARQnAQ)![无帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*BG9IQJyLHF8AAAAAAAAAAAAAARQnAQ)![反馈](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*eTWdQKCRKHwAAAAAAAAAAAAAARQnAQ)[AI](https://www.oceanbase.com/obi) 咨询热线
