Clock Applet

Snapshot of 12 Hour Clock Snapshot of 24 Hour Clock These are static snapshots. Enable Java to get working clocks. c. 1997

The AnalogClock applet accepts six parameters.

Notice the date and time is displayed in the status area of your browser when you move the mouse over one of the clocks.

On the right we see the same applet with different parameters. The "solar" scale is a 24 hour scale with midnight at the bottom and noon at the top. For this scale I chose a background which is a north polar azimuthal projection of the globe. The hour hand (the only hand) points to where it is noon.

I have a database of globes for different time zones. When getting the background image for the clock face, the applet adds a query for "timezoneOffset=m". This allows a CGI script to serve up a globe in the appropriate position, so that the local longitude is on top. Hence the hour hand still points to the correct longitude, but local noon is at the top and local midnight at the bottom. Now, isn't that more user-chummy?

OK, so it isn't all that chummy. This applet uses only standard timezones. So it doesn't take into account crooked timezone borders, or oddball things like daylight savings time. It would be better if the applet could reliably get and report your longitude. Still this is pretty close. What's a few hundred miles between friends, eh?

Thanks to Rachel Gollub for her Clock2 applet in the book Hooked on Java.


Eric Blossom Eric@BlossomAssociates.net