From 5b59a4ef1aa2c0a43026ba2f01666a361885e3a4 Mon Sep 17 00:00:00 2001 From: Kartikey Lakhotia <201751020@iiitvadodara.ac.in> Date: Tue, 9 Oct 2018 09:15:35 +0530 Subject: [PATCH] added Working Clock --- index.html | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index d6d0fe9..3812c41 100644 --- a/index.html +++ b/index.html @@ -11,11 +11,14 @@ +

Fibonacci Clock

+

+

@@ -48,9 +51,35 @@

therealvasanth

+ + function checkTime(i) { + if (i < 10) { + i = "0" + i; + } + return i; + } + + function startTime() { + var today = new Date(); + var h = today.getHours(); + var m = today.getMinutes(); + var s = today.getSeconds(); + // add a zero in front of numbers<10 + m = checkTime(m); + s = checkTime(s); + document.getElementById('time').innerHTML = h + ":" + m + ":" + s; + t = setTimeout(function() { + startTime() + }, 500); + } + startTime(); + + +