how to change timestamp format in mysql

前端 未结 5 1834
不知归路
不知归路 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:48

    Like Pekka said: Don't change the way how these values are saved.

    You can also easily handle this in php using date()

    like date("hh:ii:ss") This puts out the format you used in your example. (which is 12-hours format and leading zeros.)

提交回复
热议问题