[tz] zic option for including data from a certain year onward

Paul.Koning at dell.com Paul.Koning at dell.com
Thu Jan 31 15:04:55 UTC 2019



On Jan 31, 2019, at 7:18 AM, Christopher Wong <christopher.wong at axis.com<mailto:christopher.wong at 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mm.icann.org/pipermail/tz/attachments/20190131/ce4a9797/attachment.htm>


More information about the tz mailing list