MySQL date format

前端 未结 5 671
礼貌的吻别
礼貌的吻别 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

    No, it's not possible. But you can use DATE_FORMAT to select that way.

    SELECT Date_format(mydatefield, '%d-%m-%Y') 
    FROM   table 
    

提交回复
热议问题