<tt><font size=2>Dario,</font></tt>
<br>
<br><tt><font size=2>I think ICU4C [</font></tt><a href="http://icu-project.org/"><tt><font size=2>http://icu-project.org/</font></tt></a><tt><font size=2>]
provides features which you need.</font></tt>
<br><tt><font size=2>I'd recommend you to check following ICU user guide
sections -</font></tt>
<br>
<br><a href="http://userguide.icu-project.org/formatparse/datetime"><tt><font size=2>http://userguide.icu-project.org/formatparse/datetime</font></tt></a>
<br><a href="http://userguide.icu-project.org/datetime/timezone"><tt><font size=2>http://userguide.icu-project.org/datetime/timezone</font></tt></a>
<br>
<br><tt><font size=2>-Yoshito</font></tt>
<br>
<br><tt><font size=2>> -----Original Message-----<br>
> From: Dario Teixeira [</font></tt><a href=mailto:darioteixeira@yahoo.com><tt><font size=2>mailto:darioteixeira@yahoo.com</font></tt></a><tt><font size=2>]
<br>
> Sent: Wednesday, February 09, 2011 11:03<br>
> To: tz@lecserver.nci.nih.gov<br>
> Subject: C/C++ library that parses TZ data?<br>
> <br>
> Hi,<br>
> <br>
> I have a problem which is fairly common when one is running a web
application<br>
> that wishes to display timestamps localised towards each user's time
zone.<br>
> Basically, I need a function that takes as input a timestamp in UTC
and <br>
> a time zone specified in the Zoneinfo convention (ex: "Europe/Lisbon"),<br>
> and returns the localised version of that timestamp, including a time
zone<br>
> abbreviation aware of daylight savings.  Example:<br>
> <br>
> 2010-01-01 15:30, "Europe/Lisbon"       ->
2010-01-01 15:30 WET<br>
> 2010-01-01 15:30, "Europe/Paris"        ->
2010-01-01 16:30 CET<br>
> <br>
> 2010-07-01 15:30, "Europe/Lisbon"       ->
2010-07-01 16:30 WEST<br>
> 2010-07-01 15:30, "Europe/Paris"        ->
2010-07-01 17:30 CEST<br>
> <br>
> Since the zoneinfo data is present in every Unix system and glibc
includes<br>
> routines for parsing it, interfacing with glibc seemed the obvious
solution.<br>
> Unfortunately, glibc was not designed with this use case in mind.
 In fact,<br>
> the glibc interface to zoneinfo can be described as "sui generis"
if one<br>
> is feeling charitable, or "insane" if truth must be told.
 Specifically, to<br>
> obtain the localised version of a given timestamp, one must first
set the 'TZ'<br>
> environment variable with the target timezone, and then invoke 'localtime'.<br>
> The abbreviated name of the timezone can be found in the global 'tzname'<br>
> array: at position 'tzname[0]' if daylight savings are not in effect
and at<br>
> position 'tzname[1]' if they are.  A quick search through glibc's
bugzilla<br>
> shows I'm not the only one to find this interface anachronistic [1],
but it<br>
> also reveals that it is unlikely to change.<br>
> <br>
> So, my question is if someone is aware of some alternative library
in C <br>
> or C++ that provides this same functionality, but is friendlier towards<br>
> concurrent applications.<br>
> <br>
> Best regards,<br>
> Dario Teixeira<br>
> <br>
> [1] </font></tt><a href="http://sources.redhat.com/bugzilla/show_bug.cgi?id=11620"><tt><font size=2>http://sources.redhat.com/bugzilla/show_bug.cgi?id=11620</font></tt></a><tt><font size=2><br>
> <br>
> <br>
> <br>
>       <br>
> <br>
> <br>
</font></tt>