Created
October 28, 2015 21:34
-
-
Save rradczewski/ba81f2c7f572b1f851de to your computer and use it in GitHub Desktop.
Decadic Time Function
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
function decTime() { | |
var date = new Date(); | |
var oldSeconds = date.getSeconds()+date.getMinutes()*60+date.getHours()*60*60+date.getMilliseconds()/1000; | |
oldSeconds = oldSeconds/(1-0.136); | |
var hours = Math.floor(oldSeconds / (100*100)); | |
oldSeconds = oldSeconds % (100*100); | |
var minutes = Math.floor(oldSeconds / 100); | |
var seconds = oldSeconds % 100; | |
return hours+':'+minutes+':'+seconds; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment