snippet

Get formated (hh:mm:ss) number from second with Javascript

const toFormat = (s) => new Date(s * 1000).toISOString().substr(11, 8);

// Return 00:01:30
toFormat(90);
Related snippets