Query to convert from datetime to date mysql

后端 未结 5 754
春和景丽
春和景丽 2020-12-29 18:00

I am trying to get the date portion of a datetime field. I know I can get it with date_format, but that returns a string or \"varchar\" field. How can I convert the result t

5条回答
  •  没有蜡笔的小新
    2020-12-29 18:44

    I see the many types of uses, but I find this layout more useful as a reference tool:

    SELECT DATE_FORMAT('2004-01-20' ,'%Y-%m-01');
    

提交回复
热议问题