tags:

views:

15

answers:

1

Hi,

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 the time:

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

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

select
    time_format(`time`, '%H:%i') as time
from
    ...
Björn