Simple Digital Watch (JavaScript)

29 05 2010

Bellow is a simple JavaScript code to implement a digital watch.

When the page is loaded, the function start_watch() is called and then, Date object is used in conjunction with getHours(), getMinutes() and getSeconds() methods, to keep updating the actual time, per second. To do that, is used the setTimeout function which is calling the start_watch() method every second (or every 1000 milliseconds):

Simple JavaScript digital watch (click on the image to enlarge)


Actions

Information

Leave a comment