I need to convert and INT such as 125, to hours and minutes which will be 02:05.
I know I can do this in PHP with the following:
date('H:i',mktime(0, 125))
but how do I do this in SQL?
I tried
SEC_TO_TIME(table.minutes*60)
which works but this results in 02:05:00 and I don't want the seconds.
Any ideas?
Thanks
Use the MySQL TIME_FORMAT function:
TIME_FORMAT(SEC_TO_TIME(table.minutes * 60), '%H:%i')