Solved

reading tzdatabase for timezone definitions

Posted on 2014-04-10
5
122 Views
Last Modified: 2015-05-28
Hi Experts,
I need to programmatically read timezone info.  For example, if given America/New_York, I want to get all the following information.

"America/New_York","EST","Eastern Standard Time","EDT","Eastern Daylight Time","-05:00:00","+01:00:00","2;0;3","+02:00:00","1;0;11","+02:00:00"
0
Comment
Question by:ambuli
  • 2
5 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
Comment Utility
You will find all necessary source code at the official page for the tz db: http://www.iana.org/time-zones - or a little more precise at http://www.iana.org/time-zones/repository/releases/tzcode2014b.tar.gz

See also http://en.wikipedia.org/wiki/Tz_database#Data_structure

The reference source code includes such a compiler called zic (zone information compiler), as well as code to read those files and use them in standard APIs such as localtime() and mktime().
0
 

Author Comment

by:ambuli
Comment Utility
Thank you JKR.  Is there any library APIs.   I am looking at the code for zdump but that seems very complicated....
0
 
LVL 86

Assisted Solution

by:jkr
jkr earned 500 total points
Comment Utility
I am afraid that 'zdump.c' really seems to be what you are looking for - however it's quite poorly documented :-/
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now