Example:
seconds ="1015557";
Result should be:
11days 18h:05m:57s
How can do this in MySQL?
select concat(
format(floor(s / @day),0),
'days ',
time_format(sec_to_time(s % @day),'%Hh:%im:%ss')
) formatted_date
from (select 1015557 s) t, (select @day = 3600 * 24);
produces:
+--------------------+
| days |
+--------------------+
| 11days 18h:05m:57s |
+--------------------+