MySQL - Extracting Time in correct format

Posted by mouthpiec on Stack Overflow See other posts from Stack Overflow or by mouthpiec
Published on 2010-04-19T12:56:49Z Indexed on 2010/04/19 13:03 UTC
Read the original article Hit count: 194

Filed under:
|

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

© Stack Overflow or respective owner

Related posts about mysql

Related posts about time