Format for Zoneinfo’s Binary Files
as of 2013

All ints and time_ts are 32 bits, big endian, packed on arbitrary byte boundaries
Type Name Use
char[4] header always "TZif"
char version '\0', '2' or '3'
char[15] [future use] all '\0'
int tzh_ttisgmtcnt count of UTC/local indicators
int tzh_ttisstdcnt count of standard/wall indicators
int tzh_leapcnt count of leap seconds
int tzh_timecnt count of transition times
int tzh_typecnt count of local time types (never zero)
int tzh_charcnt total characters in all abbreviation strings
time_t[tzh_timecnt] transition times as returned by time()
unsigned char[tzh_timecnt] indices into following ttinfo array
struct ttinfo {
  int           tt_gmtoff;
  unsigned char tt_isdst;
  unsigned char tt_abbrind;
} [tzh_typecnt]
tt_gmtoff is total ISO 8601 offset (std + dst)
tt_isdst is boolean indicating DST
tt_abbrind is index to abbreviations
char[tzh_charcnt] packed '\0'-terminated abbreviations
time_t[tzh_leapcnt][2] [][0] is time() at a leap second
[][1] is count of leap seconds after time()
char[tzh_ttisstdcnt] whether local transitions are standard or wall
char[tzh_ttisgmtcnt] whether local transitions are UTC or local
Version 2:
additional copy of all the above, but with 64-bit time_ts (in yellow above), plus:
char[] "\n" POSIX TZ environment variable "\n"
Version 3 adds no data, but allows some extensions
to the “POSIX TZ environment variable”.