Convert seconds to Hour:Minute:Second

M.E picture M.E · Jul 3, 2010 · Viewed 406.4k times · Source

I need to convert seconds to "Hour:Minute:Second".

For example: "685" converted to "00:11:25"

How can I achieve this?

Answer

animuson picture animuson · Jul 3, 2010

You can use the gmdate() function:

echo gmdate("H:i:s", 685);