Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove seconds from time field?

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
like image 884
user622378 Avatar asked May 02 '11 15:05

user622378


1 Answers

SELECT
  TIME_FORMAT(opentime, "%H:%i") as opentime,
  TIME_FORMAT(closetime, "%H:%i") as closetime
FROM hours;
like image 101
Emil Vikström Avatar answered Sep 22 '22 00:09

Emil Vikström