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
...
精彩评论