|
Q1479 How can I have a clock on a webpage that syncs with the Atomic clock?
irt.org | Knowledge Base | JavaScript | Date | Q1479 [ previous next ]
Q1479 How can I have a clock on a webpage that syncs with the Atomic clock?
Have an image and change the source:
<script language="JavaScript"><!--
function showTime() {
if (!document.images) return;
now = new Date();
document.images["theTime"].src = 'http://tycho.usno.navy.mil/cgi-bin/xbmclock.xbm?zone=GMT&'+ now.getTime();
setTimeout('showTime()',60000); // update once a minute or they will be cross...
}
//--></script>
<img name="theTime" src="http://tycho.usno.navy.mil/cgi-bin/xbmclock.xbm?zone=GMT" width=192 height=28>
|
More info (timezone and such) at http://tycho.usno.navy.mil/howclock.html
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.