creating live clock using server's date & time
I need to create a live clock which always shows the current time. however the catch here is i need to first grab the date and time from the server. once i get that date & time, my script should start and the clock should start ticking. i have seen the live clock examples here but they all use a new Date() instance. hence it gets the current machine's time.
currently what i am doing is getting the server's date & time in a textbox. but from thereon i have nothing much to do. in the examples given here i dont have to do much. i just set the interval to 1000 (1 sec) and a new Date() will do the job for me. but when i grab the date from the value i fetched from server (or for that matter, any value i set in the textbox) the complexity increases. i need to increment the value of sec, minutes and hour every second, accordingly and then in turn the dates too !!!
i hope i m clear in the problem here !!!
can anyone help me in this situation...i need to keep the current time (& date) synchronized with the server's date & time (values in textbox).
thanks in advance