JS1K

#2: the original

Source for demo by Tom Hudson.

z=document.getElementById('c'),c=z.getContext('2d'),C='#DDD',L=110,w=700,lC='#000';z.width=z.height=w;c.b=c.beginPath;c.t=c.translate;c.l=c.lineTo;c.m=c.moveTo;c.r=c.rotate;c.S=c.stroke;c.a=c.arc;c.re=c.restore;c.f=c.fill;c.s=c.save;function u(){d=new Date(),cm=d.getMilliseconds(),cS=d.getSeconds(),cM=d.getMinutes(),cH=d.getHours(),fR=2*Math.PI;if(cH>12)cH=cH-12;c.fillStyle='#222';c.fillRect(0,0,w,w);c.lineWidth=8;c.s();c.b();c.strokeStyle=C;c.a(350,350,340,0,fR,0);c.S();c.re();hR=(fR/12)*(cH+(100/60*cM/100)),mR=((fR/60)*(cM+((100/60)*cS/100)))-hR,sR=((fR/60)*(cS+(cm/1000)))-mR-hR;c.strokeStyle=C;c.fillStyle=lC;c.s();c.t(350,350);c.b();c.m(0,0);c.r(hR);c.lineWidth=12;c.l(0,-L);c.S();c.b();c.a(0,0,10,0,fR,0);c.f();c.s();c.t(0,-L);c.b();c.m(0,0);c.r(mR);c.lineWidth=7;c.l(0,-L);c.S();c.b();c.a(0,0,7,0,fR,0);c.f();c.s();c.t(0,-L);c.b();c.m(0,0);c.r(sR);c.lineWidth=3;c.l(0,-L);c.S();c.b();c.a(0,0,5,0,fR,0);c.f();c.re();c.re();c.re();setTimeout(u,100);};u();