comicsite/assets/js/hexclock.js
2024-08-09 17:25:36 -05:00

19 lines
328 B
JavaScript

function ttHex()
{
var d = new Date()
var h = d.getHours();
var m = d.getMinutes();
var s = d.getSeconds();
if (h<=9) {h = '0'+h};
if (m<=9) {m = '0'+m};
if (s<=9) {s = '0'+s};
return '#'+h+m+s;
}
function updateHex() {
document.getElementById('hexClock').innerHTML = ttHex();
}
setInterval(updateHex, 1000);