You can use the DAYOFMONTH()
function in MySQL to return the day of the month from a date.
By “day of the month”, I mean a value between 1 and 31 (or 0 for dates with a zero day part), as opposed to the day of the week, such as Monday etc.
For example, if you provide a date of 2018-01-07, the DAYOFMONTH()
function will return 7.