Created
July 19, 2018 10:57
-
-
Save rusco/12c3588602d959cf46713578c3b010cd to your computer and use it in GitHub Desktop.
Convert decimal number (time) to hh:mm:ss in javascript
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
| let decimal2HHMISS = function (decimalTimeString) { | |
| let n = new Date(0, 0); | |
| n.setSeconds(+decimalTimeString * 60 * 60); | |
| return n.toTimeString().slice(0, 8); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment