开发者

MySQL - Extracting Time in correct format

I have a table with a coloumn of type "time", and the values in this coloumn are stored as follows: 20:45:00, 18:00:00, etc.

Now when displaying the result, I am not getting the minutes, but just 00. I am using the following to get t开发者_Go百科he time:

SELECT TIME_FORMAT(time, '%h:%m') as time FROM ......... etc


That's because %m answers against month - and not minutes. %i answers to minutes:

select
    time_format(`time`, '%H:%i') as time
from
    ...
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜