Back to Starrocks

dayofmonth

docs/en/sql-reference/sql-functions/date-time-functions/dayofmonth.md

4.1.0496 B
Original Source

dayofmonth

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
INT DAYOFMONTH(DATETIME date)

Examples

Plain
MySQL > select dayofmonth('1987-01-31');
+-----------------------------------+
| dayofmonth('1987-01-31 00:00:00') |
+-----------------------------------+
|                                31 |
+-----------------------------------+

keyword

DAYOFMONTH