Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- secondsToHourMinuteSecond(totalSeconds) {
- let hour = Math.floor(totalSeconds / 3600);
- let minute = Math.floor(totalSeconds % 3600 / 60);
- let seconds = Math.floor(totalSeconds % 3600 % 60);
- return `${('0' + hour).slice(-2)}:${('0' + minute).slice(-2)}:${('0' + seconds).slice(-2)}`
- }
- /*
- returns total seconds to hh:mm:ss value.
- e.g. 133 seconds = 00:02:13
- */
Add Comment
Please, Sign In to add comment