Why does TZif data in jiff-tzdb
have fewer time transitions than my /usr/share/zoneinfo
copy?
#121
-
Hi there! I was doing some testing with Just to note: I am using the Below is a super simplified version of the code. // jiff_tzdb
let Some((_, data)) = jiff_tzdb::get("America/Chicago") else { ... };
let (tzif_data, _) = tzif::parse::tzif::tzif().parse(data)?;
// Output for header2: Some(TzifHeader { version: 2, isutcnt: 0, isstdcnt: 0, leapcnt: 0, timecnt: 175, typecnt: 6, charcnt: 24 })
// fs
let data = tzif::parse_tzif_file("/usr/share/zoneinfo/America/Chicago");
// Output for header2: Some(TzifHeader { version: 2, isutcnt: 8, isstdcnt: 8, leapcnt: 0, timecnt: 236, typecnt: 8, charcnt: 24 }) Am I missing something about using |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
The tzdb files in jiff-tzdb are compiled using the "slim" format. Your system tzdb is probably compiled using the "fat" format to support broken applications or code that otherwise hasn't been updated to support v2 of TZif (which is extremely old itself). The slim version doesn't include transitions that are described by the POSIX tz rule near the end of the TZif data because they are strictly redundant. This is very likely what explains the difference. |
Beta Was this translation helpful? Give feedback.
-
Ah okay. I think |
Beta Was this translation helpful? Give feedback.
-
Eh? From the tzif README:
I'm not sure what you mean by version 1 and version 2 blocks. The slim versus fat formats are related to transitions redundant with the TZ string. |
Beta Was this translation helpful? Give feedback.
-
From looking at https://docs.rs/tzif/0.2.3/tzif/data/tzif/struct.TzifData.html, there isn't anything obviously missing there by my eye. So I'm not sure any updates are needed. This is almost certainly due to slim versus fat. It's an option you pass to the zic compiler: jiff/jiff-cli/cmd/generate/zoneinfo.rs Line 133 in 92a9dda |
Beta Was this translation helpful? Give feedback.
-
Yeah, it definitely looks like it. I was initially concerned that there was something happening in data block one that couldn't be seen (obviously not the case). |
Beta Was this translation helpful? Give feedback.
The tzdb files in jiff-tzdb are compiled using the "slim" format. Your system tzdb is probably compiled using the "fat" format to support broken applications or code that otherwise hasn't been updated to support v2 of TZif (which is extremely old itself).
The slim version doesn't include transitions that are described by the POSIX tz rule near the end of the TZif data because they are strictly redundant.
This is very likely what explains the difference.