Analog Clock Service

Analog Clock Service is a service for providing analog clock images to web (or other) applications. Clock Service API let’s you dynamically create images of an analog clock.

Clock Service is a simple servlet implementation that generates an image with the specified parameters. API can be used to define image size (s=100), timezone (tz=zone), title (t=Helsinki) and 12h/24h format (f=24). With this I can use the following URLs to produce three different clock images for three different timezones.

/clockservice/clock?tz=America/New_York&s=150&t=Atlanta&f=12
/clockservice/clock?tz=Europe/Helsinki&s=150&t=Helsinki&f=12
/clockservice/clock?tz=Australia/Sydney&s=150&t=Sydney&f=12

If you would use these URLs with HTML IMG tags then the results would look like this:

Clock (Atlanta)Clock (Helsinki)Clock (Sydney)

These images aren’t created dynamically as I don’t have any public servlet container available.

You’ll need to run this service in a servlet container such as Apache Tomcat, GlassFish or JBoss.

License: Apache License 2.0

Downloads:

  • Raf

    Hi Tommi
    Could you please explain how to use your applet in Confluence?
    Like were to save the binary WAR file and how to create a page with multiple clocks.
    Thanks!
    Raf

  • http://www.substanceofcode.com Tommi Laukkanen

    @Raf: I hosted the clock service WAR file on a different server running a Tomcat servlet container. Then in Confluence I would just use the normal image links to include the clock images on my page.

  • Anonymous

    The clock application you describe here is quite interesting, but I would like you to know that my marcasite watch has all of that:)) no software:P