Created
July 9, 2025 20:50
-
-
Save milksense/3326bb28d99f9706af129f56f9dc7f7b to your computer and use it in GitHub Desktop.
Seconds to human readable format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function formatDuration(seconds: number): string { | |
let m = Math. floor (seconds / 60); | |
let s = seconds % 60; | |
return `${m}:${s.toString().padStart(2, "0")}`; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment