[tz] Reading binary files

Bennett Todd bet at rahul.net
Wed Nov 2 15:12:56 UTC 2011


As far as I know, the choices for a high-speed timezone-switching
implementation, thread-safe, are going to a different implementation (I
don't know what would be best) or stashing the zoneinfo conversion in a
separate process as a server, a tz conversion service.
On Nov 2, 2011 11:05 AM, "Thom Hehl" <Thom at pointsix.com> wrote:

> Not if you are writing applications that need high performance processing
> of multiple timezones and access from multiple languages and platforms.
> Besides, we’re multi-threaded. Changing environment variables is simply not
> an option. Yikes! Can you say race condition.****
>
> ** **
>
> *From:* bent at latency.net [mailto:bent at latency.net] *On Behalf Of *Bennett
> Todd
> *Sent:* Wednesday, November 02, 2011 9:09 AM
> *To:* Thom Hehl
> *Subject:* Re: [tz] Reading binary files****
>
> ** **
>
> The binary files are a distraction.****
>
> What you want to do is set the environment variable TZ to the name of the
> zone you want, then call tzset which is what consults the database and
> prepares for conversion. Then localtime(3) will translate a time_t (seconds
> since the epoch) to hours, minutes, seconds, etc in the local timezone.***
> *
>
> For translating back and forth you repeatedly reset TZ, call tzset(3), and
> localtime(3). Those are the standards for Unix, the native home of the
> zoneinfo database. If you're on a different system details may vary. But on
> Unix the database is probably already installed in your system and the
> subroutines you need are already compiled into the system library.****
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm.icann.org/pipermail/tz/attachments/20111102/9a1599b1/attachment-0002.html 


More information about the tz mailing list