Clock

0:0:0

Objective: Create a working clock using the system time and Javascript.

Problem: How can we easily make all of the ticks on the clock? How can we convert the time into an angle?

Solution: By using the 'use' tag we can make only a few pieces of the clock and then just duplicate the rest around. In order to convert the times into angles we had to use a fairly simple formula where we divided both hours and minutes by 60 and then added minutes to hours, seconds to minutes and milliseconds divided by 1000 to seconds. We then multiplied hours by 30 and minutes and seconds by 6 to get the angle.