Format date in MySQL to return MonthName, Year

前端 未结 7 927
野性不改
野性不改 2020-12-30 17:26

I have rows in a table that I need to order by date. Easy enough, use the date datatype to store them, ORDER BY date blah blah.

However, I\

7条回答
  •  既然无缘
    2020-12-30 18:11

    Try this

    SELECT DATE_FORMAT(`date`,'%M %Y') AS showdate FROM table
    

    Use this site http://www.mysqlformatdate.com/ to get the (mysql) date format you want

提交回复
热议问题