Mega Code Archive

 
Categories / MySQL Tutorial / Date Time Functions
 

Using DATE_FORMAT() with an alias to tidy up the title

mysql> mysql> SELECT DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 6 MONTH), '%W the %D of %M %Y')     -> AS 'Six Months Ago'; +---------------------------------+ | Six Months Ago                  | +---------------------------------+ | Sunday the 21st of January 2007 | +---------------------------------+ 1 row in set (0.00 sec) mysql>