Take the 2-minute tour ×

Innovata publish the IATA Time Zone/Daylight Saving Time data for airline industry.
These files contains airport code, IATA Time Zone, start/stop date for UTC offset, UTC offset and longitude/latitude for the airport.

What is the best practice to convert an IATA Time Zone into Olson Db/Tz Database format or DateTimeZone for use with Joda Time?

share|improve this question
Do you have any more information about the format of these files? –  Jon Skeet Sep 16 '11 at 15:14
@Jon Skeet: I think it is possible to get sample files from Innovata. They are text files with offset from UTC, IATA Timezone code (country code + number/letter), latitude/longitude. (mail info@innovata-llc.com) –  Kb. Sep 16 '11 at 15:17
But presumably with dates for changes as well... can you use DateTimeZoneBuilder easily? (Were you aware of that before?) –  Jon Skeet Sep 16 '11 at 15:20
Yes date and time for changes. –  Kb. Sep 16 '11 at 15:26
What do you need to do with the DateTimeZone after you have it? In particular, do you need to just use if for computation, or do you need to output a name for it too? Also, the input includes "start/stop date for UTC offset" - does this mean multiple records for a given airport, one for each DST/ST year-part in the schedule? –  Ed Staub Sep 16 '11 at 15:46
show 1 more comment

2 Answers

up vote 1 down vote accepted

Already added in a comment, but...

I suspect it would be easiest to just parse the file and create DateTimeZone instances via DateTimeZoneBuilder. You could also potentially implement ZoneInfoProvider if you didn't want to pass the zones around.

share|improve this answer
DateTimeZoneBuilder could do the job, but it is a lot of work to map from IATA time zone codes to DateTimeZone codes. –  Kb. Sep 16 '11 at 15:28
@Kb: Really? If the IATA file gives you the ID, offsets and dates/times of changes, I can't see how it would be very much work. –  Jon Skeet Sep 16 '11 at 16:34
The ID is not the Olson db/TZ Database ID. Offsets/dates/tmes are given. The job is to map olson db style ID to IATA style ID (en.wikipedia.org/wiki/IATA_code#IATA_timezone_codes), or maybe I am just lazy. ;)) –  Kb. Sep 16 '11 at 16:53
@Kb: That's not at all what you asked for though - you asked for a way of converting an IATA time zone into either a DateTimeZone or Olsen format. What I've proposed is a reasonably simple way of converting IATA time zone data into a DateTimeZone via DateTimeZoneBuilder. Joda Time doesn't need the ID to be a valid Olsen ID. If you just need to do arithmetic with the time zone, why don't you just use the DateTimeZoneBuilder, build a DateTimeZone and then use it? –  Jon Skeet Sep 16 '11 at 16:56
Yes you are right and your answer is the closest to a solution. All I have to do now is to start mapping the IDs or YES just use the IATA IDs in Joda! ;)) –  Kb. Sep 16 '11 at 16:57
show 2 more comments

Have you considered converting the UTC offset to DateTimeZone instead?

share|improve this answer
Using factory method forOffsetHoursMinutes? I am not sure the Joda offset includes the DST? –  Kb. Sep 16 '11 at 15:20
Yes, and yes. So you'd need to pick the right record, based on the start/stop date. Then, because it has no rules, the DateTimeZone is what it is - there's effectively no concept of DST/no-DST; the offset is fixed. Alternatively, sort all the records for an airport in start order and use them with DateTimeZoneBuilder. –  Ed Staub Sep 16 '11 at 16:10
add comment

Your Answer


