Bedework timezones

With 3.5 timezones have changed significantly.

Prior to this we maintained timezones within the bedework database. In addition we retained user owned timezones as well as a set of standard timezones.

With 3.5 we eliminated user timezones completely. Too much complication and too many problems arose from preserving timezone inormation we received.

For example, many systems use a truncated timezone specification which only handles the timezone rules in force at the time. Future times will probably be incorrect with these specifications.

In addition, when timezones change, these private copies do not get updated.

With 3.5 we introduce a timezone server which delivers timezone information and a set of aliases. This service can be updated by replacing a zip file at a known location.

Building the timezones zip file

This involves creating the timezone information from the latest Olson data - adding the alias file and zipping it all up.

  1. Decide on a place for the latest copy of the timezone information. For example in the quickstart we have data/timezones/current
  2. Set this path in the configuration properties for the timezone server
           org.bedework.app.tzsvr.zoneinfo=
            ${org.bedework.project.bedework}/../data/timezones/current/zoneinfo
    
  3. Download the latest timezone data. Instructions (out of date) are at http://www.twinsun.com/tz/tz-link.htm. Place them in some other location.
    1. Data at ftp://elsie.nci.nih.gov/pub/
    2. vzic can be downloaded from http://sourceforge.net/project/showfiles.php?group_id=173654
  4. Expand vzic
  5. Expand the tzdata - should give you a folder with a name like tzdata2008i
  6. cd into the vzic directory, edit the makefile and set the variables
    1. OLSON_DIR: where you expanded the data
    2. PRODUCT_ID: e.g "-//Bedework.org//NONSGML Bedework//EN"
    3. TZID_PREFIX set to null.
    4. 'make' (I had to install libglib-2.0-dev to get it to compile)
    5. vzic [--pure] (omit the pure for allegedly better outlook compatability - but not altogether correct timezones)
  7. Copy the newly created zoneinfo directory into your current zoneinfo place defined above.
  8. Copy the alias file into the same place
    cp ~/quickstart/bedework/projects/bwtzsvr/resources/aliases.txt ~/quickstart/data/timezones/current/
    
  9. cd into the directory containing zoneinfo and th ealias file and zip the contents as tzdata.zip
    cd ~/quickstart/data/timezones/current/
    zip -r tzdata *
    
  10. Copy the resulting file to the location specified by the url in your tzserver config, by default in the webapps/ROOT directory of tomcat in the quickstart
  11. Rebuild or restart your timezones server
  12. Start tomcat and browse to your timezone server with the request parameter aliases, e.g. http://localhost:8080/tzsvr?aliases

Timezones server requests

The timezones server is a simple server which provides the following:

  1. A list of timezone names - request parameter "names"
  2. A timezone in VTIMEZONE format - request paramaeter "tzid=name"
  3. A set of aliases in proeprty file format - request parameter "aliases"
  4. Some statistics - request parameter "stats"
  5. Date/time conversion - e.g.
    http://localhost:8080/tzsvr/?convert=&dt=20090211T131800&fromtzid=America/New_York&totzid=Europe/London
    

It is presumed that usage will be very low. Both bedework and the timezones server cache timezone information. Bedework shoul donly call the timezones server once each for the list of aliases and timezone names and once per timezone. This should be reflected in the timezone stats which should show almost no activity.