On Wed, Jan 12, 2011 at 10:30 AM, Han, Aimin <Aimin.Han@morganstanley.com> wrote:
Dear friends, can anybody tell me how to read the tz database programmatically? Any help documents out there?
Thanks! Aimin
If you mean the source files, 1) I wrote a paper ( http://www.cstdbill.com/tzdb/tz-how-to.html ), mostly for my own benefit, explaining how /H. sapiens/ can read the files. (I think I got it right...if I made any mistakes, I'd love to hear about them from the experts, which I'm not.) Of course, the Hawai'i example was written before the changes that ADO just announced. 8-) 2) I wrote a paper ( http://www.cstdbill.com/tzdb/db.html ) suggesting one way to put tz data in a SQL database. If you click on the link to Appendix B, you'll get to some links to an open-source library in C++ that parses the Zone, Rule and Link lines and loads the data into standard-library collections. If you mean the data files, 3) I made an HTML table ( http://www.cstdbill.com/tzdb/tzfile-format.html ), again mostly for my own understanding, that shows the format of tz's binary files. As with 1) above, I'd appreciate knowing about it if any expert sees something that I got wrong. HTH, --Bill Seymour