Atomic Clock

By John Weeks


Sorry, IE Is Not Supported

This clock provides 10 seconds of real-time atomic clock data from the US Naval Observatory in Washington D.C. Press "Reload" to restart the display. Note...this does not work with Microsoft Internet Explorer. Microsoft has a bug in their support of multipart/x-mixed-replace content type. Safari also fails to display this clock, while Mozilla, Netscape, and Firefox displays it correctly.

Here is the HTML code to call the Atomic Clock display:

<img src="http://tycho.usno.navy.mil/cgi-bin/nph-usnoclock.gif? zone=CDT|ticks=10" alt="Sorry, IE Is Not Supported">


For those with IE, here is a static time display:

Static Atomic Clock Display

Here is the HTML code to call this time display:

<img src="http://tycho.usno.navy.mil/cgi-bin/xbmclock.xbm?zone=CDT">


The clock in the status bar at the bottom of your browser screen is your local PC time.

Here is the JAVAscript code for the local time display below. Place this code in the <Head> section of your HTML page.


<script type="javascript">
<!--
function showTime() {
  var now = new Date()
  var hrs = now.getHours()
  var mins = now.getMinutes()
  var secs = now.getSeconds() 
  var mm = ((hrs>11) ? " PM" : " AM")
  hrs=((hrs>12) ? (hrs-12) : hrs)
  hrs=((hrs==0) ? 12 : hrs)
  var disp = "Local Time: " + hrs + ":"
  disp += ((mins<10) ? "0" : "" ) + mins + ":"
  disp += ((secs<10) ? "0" : "" ) + secs + mm
  status = disp
  setTimeout("showTime()",20)
}
// -->
</script>

To actually run this script, add the following code to your <body> tag:

<body onLoad="showTime()">


Thanks to the US Navy for providing on-line access to the atomic clock time services. For more information, visit the US Naval Observatory, Time Service Department, at tycho.usno.navy.mil.

Home  Return To John Weeks Hobby Page
Home  Return To John Weeks Home Page
Authored by John A. Weeks III, Copyright © 1996, all rights reserved.
For further information, contact: john@johnweeks.com