how to change timestamp format in mysql

前端 未结 5 1707
不知归路
不知归路 2021-01-26 02:37

Is it possible to change the current 24 hr format like 22:16:08 to something like 10:16:08 in mysql? I want to change how these values are saved. Is it possible or I will just l

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-26 02:52

    You really shouldn't change how the data is saved in MySQL. Instead you should only present it differently. You can use PHP's date function to format the date in anyway you want. This is a huge advantage because you are separating how the data is saved and how the data is presented.

提交回复
热议问题