I want to create a table column that has a hh:mm format. How do I do that?
I’ve tried it with time(0) but that also gives me the seconds.
CREATE TABLE courseTimes ( startingTime time(0), endingTime time(0) );
I want the entries to look like
startingTime 19:25
endingTime 20:10
for example.
Advertisement
Answer
You can retrieve the time and format it like this.
Select TIME_FORMAT(startingTime),'%H:%i' ), TIME_FORMAT(endingTime),'%H:%i' )