On Fri, Mar 26, 2004 at 12:51:20AM -0600, Ed Perrone <[EMAIL PROTECTED]> wrote: > I am working on an application where the user will input a date, time, and > location, and I will need to convert that time into the equivalent > GMT. This means I will need to locate the input data within one of the > Olsen time zones in order to create and manipulate a Date::Time object. > > Unfortunately, "city/province/nation" or "latitude/longitude" don't seem to > convert easily into the time zone names used in Date::Time. > > Example: User inputs May 15, 1973, Austin, TX, USA. I need to figure out > which of the Olsen zones "Austin TX" is located in. I will have available > the city/state-province/nation name, as well as ISO-3166-2 codes for > US/Canada states/provinces, FIPS 10-4 codes for other nations/regions, and > longitude/latitude of the specific place in question. What I need to find > from this is the proper time zone to use for that date/location. > > Does anyone know of any tool or routine that might be able to do this type > of conversion? > > Many thanks!
You could go through the comments in the Olson files; they will say where the timezones apply, and you should be able to come up with a pretty good state/nation->timezone table. (If you do this, please post it here.) For some of the U.S. states, it is helpful to know the county. There's also a zone.tab file that gives latitude/longitude for the cities the timezones are named after. As a last ditch guess, you could pick the one that's closest. The original files can be found at: ftp://elsie.nci.nih.gov/pub/tzdata2003e.tar.gz