Skip to content

Instantly share code, notes, and snippets.

@cmartello
Created October 24, 2019 09:01
Show Gist options
  • Save cmartello/b99284c3426f2dbba9f39a494ef4af68 to your computer and use it in GitHub Desktop.
Save cmartello/b99284c3426f2dbba9f39a494ef4af68 to your computer and use it in GitHub Desktop.
<HTML>
<HEAD>
<TITLE>tick tock</TITLE>
<SCRIPT>
var x = 0;
var z = 1325 / 3600
function rightnow() {
var out = document.getElementById("write");
var t = new Date();
var h = t.getHours();
var m = t.getMinutes();
var s = t.getSeconds();
// calculate seconds past 8 am
seconds = ((h-8)*3600) + (m*60) + s
// turn it into a cash value
out.innerHTML = '$'.concat(((seconds*z)/100).toFixed(2).toString())
}
window.setInterval(rightnow, 1000);
</SCRIPT>
</HEAD>
<BODY>
<H1 id="write"></H1>
</BODY>
</HTML>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment