import clock from "clock"; import document from "document"; clock.granularity = "seconds"; // seconds, minutes, hours const clockLabel = document.getElementById("clock-label"); clock.addEventListener("tick", (evt) => { clockLabel.text = evt.date.toTimeString().slice(0, -4); });
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter