Setting time zone in c language

Vinod L R vinodl at
Tue Apr 8 05:23:22 UTC 2008


I have a GUI interface ,where in user selects the Area (for ex: Africa)
and Zone name(for ex: Cairo).How do i map this /etc/TZ file,as there
will be different Area and Zone

to be set.Is there any functions in "C' which would solve my issue or
any other method ?

I found that uClibc uses /etc/TZ to set the time zone it does not use
/etc/localtime nor does it understand the timezone data .so will
changing UCLIBC_TZ_FILE_PATH it to /etc/localtime in
uClibc-0.9.29.config file will solve my issue??

how do I map this to /etc/localtime so as to set a valid timezone.

The procedure I tried is :

ln -sf /usr/share/zoneinfo/Africa/Cairo /etc/localtime.

alternatively I find that executing echo CET-1DST >/etc/TZ does work.

Please update me on how to solve this issue in C program ( for ex: Take
Africa/Cairo as input and convert to its respective daylight saveing
time as above )


This email message and its attachments may contain CONFIDENTIAL AND PRIVILEGED INFORMATION intended for the sole use of the addressee(s). If you have received it in error, please contact the sender by return email, notify your system manager and destroy the original message and any copies thereof. Any review, use, disclosure or distribution is unlawful. Please check this email and any attachments for the presence of viruses. The Company accepts no  liability for any damage caused by any virus transmitted by this email. The views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of the company.
The Company reserves the right to monitor, review and store the content of all messages sent to or from this e-mail address.
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the tz mailing list