You should do it in javascript, however when you take time or date through javascript, it is user specific.
user's machine date time may be wrong and you should not rely on that.
you should take current time through server script
System.DateTime.Now()
on pageLoad, and write a function in javascript to increment it every second.
Hope you got the logic.