Change date format (in DB or output) to dd/mm/yyyy - PHP MySQL

前端 未结 8 1887
南笙
南笙 2020-11-29 11:18

MySQL stores the date in my database (by default) as \'YYYY-MM-DD\' The field type for my date is \'DATE\' (I do not need any time storage).. Is there a simple way to change

8条回答
  •  独厮守ぢ
    2020-11-29 11:39

    Just use the Mysql built in function DATE_FORMAT()

    SELECT DATE_FORMAT(some_date_field, "Y/m/d");
    

提交回复
热议问题