MySQL 8.4
DAYOFMONTH(date)- date
- Date or datetimeDATE
Return value
An integer from 1 to 31; 0 for a date with a zero day, for example 2022-00-00; NULL if the value is not recognized as a date
Examples
Day of the month from a date
MySQL 8.4
SELECT DAYOFMONTH('2022-06-16');Day of the month for birthdays
MySQL 8.4
SELECT member_name,
DAYOFMONTH(birthday) AS birth_day
FROM FamilyMembers;Details
The function is a synonym for DAY.