Skip to content

Instantly share code, notes, and snippets.

@nashingofteeth
Forked from anonymous/clock.html
Last active August 29, 2015 14:13
Show Gist options
  • Save nashingofteeth/2cf1b764e78e011662e9 to your computer and use it in GitHub Desktop.
Save nashingofteeth/2cf1b764e78e011662e9 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
function setTime() {
var timeOut = false;
var currentDate = new Date();
var seconds = currentDate.getSeconds();
var minutes = currentDate.getMinutes() * 60;
var hours = currentDate.getHours() * 3600;
var myriaseconds = seconds + minutes + hours;
var mt = myriaseconds/10000;
document.body.innerHTML = mt.toPrecision(5);
setTimeout(function() {var timedOut = true}, 1000);
}
window.onload=setInterval(function(){setTime()});
</script>
<span></span>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment