MySQL 8.1
MONTHNAME(date)Parameters
- dateDATE
- Date or datetime
Return value
A string with the month name, in English by default, for example June; NULL for a date with a zero month and for an unrecognized value
Examples
Name of the month
MySQL 8.1
SELECT MONTHNAME('2022-06-16');Month of birth
MySQL 8.1
SELECT member_name,
MONTHNAME(birthday) AS birth_month
FROM FamilyMembers;Details
The language of the name is set by the lc_time_names variable: after SET lc_time_names = 'de_DE' the function returns «Juni». Sort by months using MONTH: names are sorted alphabetically, and April comes before January.