[tz] [Patch] Make it slightly easier to parse tzdata

Ed Schouten ed at 80386.nl
Fri Oct 31 14:56:09 UTC 2014


Hi there,

Right now I am experimenting with trying to integrate the tzdata
dataset into an embedded setup where I am not able to use zic(8) +
/usr/share/zoneinfo. To summarize, my plan is to translate the entire
tzdata into a set of C array/structure initializers (~50 KB for all
timezones) and perform operations on those structures directly.

While writing a Python script to translate the data, I noticed that
there is a very small number of directives that would require quite a
lot of additional code to parse properly. For example, "lastSun" makes
a lot of sense as a special keyword in "Rule" directives, but it
provides no functional gain in "Zone" directives.

The same holds for the use of the "Dec 29 24:00" time used in Samoa's
timezone. We should be able to use "Dec 30" instead, right?

Anyway, I've attached a patch that should make it slightly easier to
parse the tzdata files by removing these constructs. This should make
it easier for people to reuse the dataset for other purposes.

Thanks,
-- 
Ed Schouten <ed at 80386.nl>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tzdata.patch
Type: application/octet-stream
Size: 4301 bytes
Desc: not available
URL: <http://mm.icann.org/pipermail/tz/attachments/20141031/ac500c4b/tzdata.patch>


More information about the tz mailing list