The time zone database you are describing already exists. It's called the Olson zoneinfo database, it's correct for all dates after 1970, and it's available online.
Better yet, Java's native date-and-time APIs use this database. You can load an arbitrary time zone using java.util.TimeZone.getTimeZone()
, and get offsets or perform conversions using this object (e.g, using TimeZone.getOffset(long)
. For instance, you'd load the "America/Indiana/Indianapolis"
zone to convert dates and times in Indiana.
The one thing you can't do easily with the TimeZone
database is actually query the rules it's using. For that, I believe you'd have to dig into the tz files directly. In most cases, though, just getting offsets for specified dates should be sufficient.