Retrieve the day of the month from a given date.
SELECT DAYOFMONTH(“2017-06-15”); |
The DAYOFMONTH() function retrieves the day of the month from a specified date, represented as a number ranging from 1 to 31.
Note: This function is equivalent to the DAY() function.
DAYOFMONTH(date) |
Parameter |
Description |
date |
Necessary. Specify the date from which to extract the day. |
Works in: |
From MySQL version 4.0 |
Retrieve the day of the month for a given date.
SELECT DAYOFMONTH(“2017-06-15 09:34:21”); |
Retrieve the day of the month for the current system date.
SELECT DAYOFMONTH(CURDATE()); |