Home »
MySQL »
MySQL date/time Functions
MySQL DAYOFMONTH() Function
MySQL | DAYOFMONTH() Function: Learn about the DAYOFMONTH() function, how it works, its usages, syntax, and examples.
Submitted by Apurva Mathur, on October 04, 2022
DAYOFMONTH() Function
When you want to find out the day part of any date then in such case we can use this DAYOFMONTH() function. This function is used to get the day part from the given date.
DAYOFMONTH() Syntax
SELECT DAYOFMONTH('DATE');
DAYOFMONTH() Parameter(s)
- DATE: It accepts a date for which you have to get the day of the month.
DAYOFMONTH() Return Value
As a result, it will return you the day part from the date you provided.
MySQL DAYOFMONTH() Function Example 1
SELECT DAYOFMONTH('2021-01-12');
MySQL DAYOFMONTH() Function Example 2
SELECT DAYOFMONTH('2011-01-18');
MySQL DAYOFMONTH() Function Example 3
SELECT DAYOFMONTH('2011-01-40');
If the date is not valid then in such case it will return you the NULL.