I have a need to printf the time, date and daylight savings time
indicator for a series of countries (and states when there is more
than one timezone in the country), given a specific date and time.
Does anyone have a pointer to an example of how to make proper use of
the time zone databases to find the right time, given a location? I
suspect that I will have to hand code the mapping of the locations to
timezones, and then just convert the time to the various timezones,
right?
I've asked a couple of times in this forum, without success, looking
for a package that will allow concurrent access to different timezones
in multiple threads. The ordinary system routines won't do, because
of their dependency on the shared global TZ environment. The lack
of response tells me that a full understanding of this issue is not
widespread.
I went looking for such a package. There don't seem to be
many, and there are still outstanding proposals to improve the
next revision of the C language standard. But as for practical
implementations one can use today ...
Boost:
ate_Time is one such and its documentation is
extensive, but it's also impenetrable. I reject that package
until such time as there is enough readable tutorial material
that one is not stuck with essentially reverse engineering
the code.
It looks like I've found the solution by properly generalizing.
Timezone handling is a subset of the larger issue of i18n.
And the "International Components for Unicode" package
(
http://icu.sourceforge.net/) is designed to cover that ground.
It has proper support for the Olson timezones, for concurrent
access to the same or different timezones by the same or
different threads, and support for the usual parsing and
formatting tasks.
It might not help you if you think you've already solved
your issue with the standard routines, but I thought I should
leave this breadcrumb behind for the next person to travel
this road.
Glenn