VeloDB Cloud
SQL Manual
Functions
date-time-functions
dayofmonth

dayofmonth

Description

Syntax:

INT DAYOFMONTH (DATETIME date)

This function calculates the day of month based on the date, and returns values ranging from 1 to 31.

The parameter is of DATE or DATETIME type.

Example

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

Keywords

DAYOFMONTH