Skip to content

Instantly share code, notes, and snippets.

@andreasvirkus
Last active November 10, 2019 10:01
Show Gist options
  • Save andreasvirkus/80ace51a14a4dbf96c594f3df00550e7 to your computer and use it in GitHub Desktop.
Save andreasvirkus/80ace51a14a4dbf96c594f3df00550e7 to your computer and use it in GitHub Desktop.
<!-- Digital clock -->
<a id=a>
<script>
setInterval`a.innerHTML=new Date().toLocaleTimeString('fr')`
</script>
<!-- Analog clock -->
<x id=c>
<script>
setInterval(eval(a="c.innerHTML='&#'+(128336+((h=(n=new Date).getHours(c.style.fontSize='20vw')%12)?h-1:11)+(n.getMinutes()>29&&12)),a"),1e3)
</script>
@andreasvirkus
Copy link
Author

andreasvirkus commented Nov 9, 2019

The analog clock's emoji represents the last applicable half of an hour (meaning 10:58 will not display 11).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment