zic option for including data from a certain year onward

Hi, I think the tzdb is very good with its history. However, I would like to minimize the size and has been looking into how to achieve that. Will it be of any interest with an option in zic to include only data from a certain year onward? What is the best way? 1.? Remove the Rules and Zone entries not relevant for that year onward during the parsing. Tried this, but ended up with with some nasty warnings. 2. Make changes in writezone-function. Trying this now, but I am getting confused with types, omittype, typemap, and so on. It would be good if someone that knows the code can give me some hints if this is the right place to make such a change. BR, Christopher Wong

On Jan 31, 2019, at 7:18 AM, Christopher Wong <christopher.wong@axis.com<mailto:christopher.wong@axis.com>> wrote: Hi, I think the tzdb is very good with its history. However, I would like to minimize the size and has been looking into how to achieve that. Will it be of any interest with an option in zic to include only data from a certain year onward? What is the best way? 1. Remove the Rules and Zone entries not relevant for that year onward during the parsing. Tried this, but ended up with with some nasty warnings. 2. Make changes in writezone-function. Trying this now, but I am getting confused with types, omittype, typemap, and so on. It would be good if someone that knows the code can give me some hints if this is the right place to make such a change. BR, Christopher Wong Yes, this is a very useful feature. I did it years ago for an embedded system product. The right answer is 2 -- a new command line switch in zic to specify the start year, and a simple change in writezone to omit writing data for transitions older than the start date. You have to be a bit careful to make sure that the rule in effect AT the start date appears in the output, i.e., not just transitions that are later than the start date. I don't have the original vs. changed code at hand, unfortunately. By the way, if you create such trimmed output files, they are indeed a lot shorter. But in addition, there are many duplicates because a lot of locations have common transitions if you only consider recent ones. (In our case we only needed to handle time stamps newer than the first product release date, so I started the files at 2002.) This allows replacing many of the files with softlinks, or better still if you have them, hardlinks, for additional space savings. paul

On 1/31/19 10:04 AM, Paul.Koning@dell.com wrote:
On Jan 31, 2019, at 7:18 AM, Christopher Wong <christopher.wong@axis.com <mailto:christopher.wong@axis.com>> wrote:
Hi,
I think the tzdb is very good with its history. However, I would like to minimize the size and has been looking into how to achieve that.
Will it be of any interest with an option in zic to include only data from a certain year onward?
What is the best way? 1. Remove the Rules and Zone entries not relevant for that year onward during the parsing. Tried this, but ended up with with some nasty warnings. 2. Make changes in writezone-function. Trying this now, but I am getting confused with types, omittype, typemap, and so on.
It would be good if someone that knows the code can give me some hints if this is the right place to make such a change.
BR, Christopher Wong
Yes, this is a very useful feature. I did it years ago for an embedded system product. The right answer is 2 -- a new command line switch in zic to specify the start year, and a simple change in writezone to omit writing data for transitions older than the start date. You have to be a bit careful to make sure that the rule in effect AT the start date appears in the output, i.e., not just transitions that are later than the start date.
To this point, truncation of TZif files is discussed here: https://tools.ietf.org/html/draft-murchison-tzdist-tzif-16#section-5.1 -- Ken Murchison Cyrus Development Team FastMail US LLC

Hi Paul, thanks for letting me know that I am on the right path choosing to make the change in writezone. Hi Ken, thanks for the link to RFC draft. I will probably truncate the start of a TZif file and it states the following in the draft: When truncating the start of a TZif file, the service MUST supply in the version 2+ data a first transition time that is the start point of the truncation range. As with untruncated TZif files, time type 0 indicates local time immediately before the start point, and the time type of the first transition indicates local time thereafter.? Does it mean I need to add a start point transition to version 2+, but not to the version 1? BR, Christopher Wong ________________________________ From: tz <tz-bounces@iana.org> on behalf of Ken Murchison <murch@fastmail.com> Sent: Thursday, January 31, 2019 16:08 To: tz@iana.org Subject: Re: [tz] zic option for including data from a certain year onward On 1/31/19 10:04 AM, Paul.Koning@dell.com<mailto:Paul.Koning@dell.com> wrote: On Jan 31, 2019, at 7:18 AM, Christopher Wong <christopher.wong@axis.com<mailto:christopher.wong@axis.com>> wrote: Hi, I think the tzdb is very good with its history. However, I would like to minimize the size and has been looking into how to achieve that. Will it be of any interest with an option in zic to include only data from a certain year onward? What is the best way? 1.? Remove the Rules and Zone entries not relevant for that year onward during the parsing. Tried this, but ended up with with some nasty warnings. 2. Make changes in writezone-function. Trying this now, but I am getting confused with types, omittype, typemap, and so on. It would be good if someone that knows the code can give me some hints if this is the right place to make such a change. BR, Christopher Wong Yes, this is a very useful feature. I did it years ago for an embedded system product. The right answer is 2 -- a new command line switch in zic to specify the start year, and a simple change in writezone to omit writing data for transitions older than the start date. You have to be a bit careful to make sure that the rule in effect AT the start date appears in the output, i.e., not just transitions that are later than the start date. To this point, truncation of TZif files is discussed here: https://tools.ietf.org/html/draft-murchison-tzdist-tzif-16#section-5.1 -- Ken Murchison Cyrus Development Team FastMail US LLC

On 2/4/19 3:06 AM, Christopher Wong wrote:
Does it mean I need to add a start point transition to version 2+, but not to the version 1?
Yes, that falls under the guideline in draft-murchison-tzdist-tzif-16 section 4 saying that version 1 data can be a contiguous subsequence of Version 2+ data. Look for the word "contiguous" in the draft.
participants (4)
-
Christopher Wong
-
Ken Murchison
-
Paul Eggert
-
Paul.Koning@dell.com