Open this example in the interactive library
Source code
const seconds = 185;
console.log(
Math.floor(seconds / 60) + ":" + String(seconds % 60).padStart(2, "0"),
);
Sample output
3:05

Open this example in the interactive library
const seconds = 185;
console.log(
Math.floor(seconds / 60) + ":" + String(seconds % 60).padStart(2, "0"),
);
3:05