Created
July 23, 2019 21:03
-
-
Save fob2257/f82261909fca2914d97afca49c6d2d32 to your computer and use it in GitHub Desktop.
This file contains 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
const getTotalTime = seconds => { | |
let hh = Math.floor(parseInt(seconds) / 3600); | |
let mm = Math.floor((seconds - (hh * 3600)) / 60); | |
let ss = seconds - (hh * 3600) - (mm * 60); | |
if (hh < 10) { hh = `0${hh}`; } | |
if (mm < 10) { mm = `0${mm}`; } | |
if (ss < 10) { ss = `0${ss}`; } | |
return `${hh}:${mm}:${ss}`; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment