Function Reference

MONTHNAME

PostgreSQL equivalent:

Returns the month name of a date.

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');
MONTHNAME('2022-06-16')
June

Month of birth

MySQL 8.1
SELECT member_name,
	MONTHNAME(birthday) AS birth_month
FROM FamilyMembers;
member_namebirth_month
Headley QuinceyMay
Flavia QuinceyFebruary
Andie QuinceyJune
Lela QuinceyJune
Annie QuinceyApril
Ernest ForrestSeptember
Constance ForrestSeptember
Wednesday AddamsJanuary

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.

See also