MCPcopy Create free account
hub / github.com/ampproject/amphtml / secondsToTimestampString

Function secondsToTimestampString

extensions/amp-lightbox-gallery/0.1/utils.js:33–41  ·  view source on GitHub ↗
(seconds)

Source from the content-addressed store, hash-verified

31 * @package
32 */
33export function secondsToTimestampString(seconds) {
34 const h = Math.floor(seconds / 3600);
35 const m = Math.floor(seconds / 60);
36 const s = Math.floor(seconds % 60);
37 const hh = padStart(h.toString(), 2, '0');
38 const mm = padStart(m.toString(), 2, '0');
39 const ss = padStart(s.toString(), 2, '0');
40 return hh + ':' + mm + ':' + ss;
41}

Callers 2

Calls 2

padStartFunction · 0.90
toStringMethod · 0.45

Tested by

no test coverage detected