Skip to content

Instantly share code, notes, and snippets.

@Philmist
Created February 19, 2021 13:25
Show Gist options
  • Save Philmist/fc5717a84031137ffd964a9adb7b5974 to your computer and use it in GitHub Desktop.
Save Philmist/fc5717a84031137ffd964a9adb7b5974 to your computer and use it in GitHub Desktop.
Simple Clock
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>A simple clock</title>
<style>
@import url('https://fonts.googleapis.com/css?family=Graduate&display=swap');
div {
font-family: 'Graduate', cursive;
}
</style>
</head>
<body translate="no" class="clock_body">
<div id="output" class="clock_text"></div>
<script src='https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js'></script>
<script>
const output = document.getElementById("output");
setInterval(
() => {
output.innerText = moment().format('HH:mm:ss');
}, 500);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment