Mega Code Archive

 
Categories / MySQL Tutorial / Date Time Functions
 

Getting Names for Months and Days

There are two functions that can be used to look up month and day names for a given date: MONTHNAME(date) DAYNAME(date) MONTHNAME(date) can be used to obtain the name of the month in which date occurs as a string mysql> mysql> SELECT MONTHNAME('0-2-1'); +--------------------+ | MONTHNAME('0-2-1') | +--------------------+ | February           | +--------------------+ 1 row in set (0.00 sec) mysql>