Topic: Need a dynamic Javascript clock that shows UTC time under any circumstances |
|
---|---|
Author | Thread |
Bipolar (III) Inmate From: you tell me |
posted 06-10-2007 16:38
Hi guys I need some help here.. I need a javascript clock component that displays the correct UTC time no matter what the time on the client machine is. Any ideas on this? |
Paranoid (IV) Inmate From: Norway |
posted 06-10-2007 18:47
If by correct you mean correct within the margin of error of trip from the server to the client, then it's pretty easy to inject the UTC timestamp into the JS served to the client. Which script will use the UTC timestamp ( assuming the clock of the server is not completetly off either, but that's unlikely ) as the basis to instanciate a Date object. Voilà. |
Paranoid (IV) Inmate From: Norway |
posted 06-11-2007 09:33 |