Skip to content

Instantly share code, notes, and snippets.

@raspberrypisig
Created April 28, 2020 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raspberrypisig/64c4079479295043fb8a77d07005af73 to your computer and use it in GitHub Desktop.
Save raspberrypisig/64c4079479295043fb8a77d07005af73 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>A simple clock</title>
</head>
<body translate="no" >
<div id="output"></div>
<script>
var c;
setInterval(
c = function() {
//output.innerText = moment().format(urlParams["format"] || '');
//output.innerText = moment().format("H:MM:SS A")
const d = new Date();
const h = d.getHours();
const m = d.getMinutes();
let mm = m.toString();
if (m<9) {
mm = "0" + m
}
const am = (h>12)?"PM":"AM";
output.innerText = h.toString() + ":" + mm + " " + am;
}, 100);
c();
</script>
</body>
</html>
<!--
OBS->Browser->Custom CSS
body {
color: white;
font-size: 100px;
}
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment