开发者

Remove seconds from time field?

开发者 https://www.devze.com 2023-03-02 20:09 出处:网络
How do I remove seconds and only show hh:mm? The field type is time. Eg: SELECT opentime, closetime FROM hours

How do I remove seconds and only show hh:mm?

The field type is time. Eg:

SELECT opentime, closetime FROM hours

Result:
17:00:00  |  23:00:00
17:30:00  |  23:开发者_开发百科40:00


SELECT
  TIME_FORMAT(opentime, "%H:%i") as opentime,
  TIME_FORMAT(closetime, "%H:%i") as closetime
FROM hours;
0

精彩评论

暂无评论...
验证码 换一张
取 消