Possible duplicate:
Convert seconds per hour: Minutes: seconds
I searched all over the internet to find a good way to convert seconds to minutes: seconds without leading zeros. I already checked this question , which was the only one I could even find, however, none of these answers look very good. Perhaps this is the only and best way to achieve this, but I would not have hoped.
I did this and it gives me the number of minutes without leading zeros, however I cannot get a second. The only way I can do this is to do a few lines of math, etc., but it seems like terrible work on something simple than this ... that I donβt know why PHP doesnβt. If it were built in minutes and seconds anyway ....
intval(gmdate("i:s", $duration));
Edit All I am trying to do is convert the number of seconds in a video to H: M: S format.
source share