MySQL date format

前端 未结 5 662
礼貌的吻别
礼貌的吻别 2020-11-29 08:06

When I make a table and create a field of type date in mysql, it stores date like 0000-00-00. Is it possible to change the format to \'d-m-Y\'?

5条回答
  •  眼角桃花
    2020-11-29 08:15

    I see the use for both, but I find this layout more useful as a reference tool:

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

提交回复
热议问题