This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PING^2] RFC [PATCH] BZ#1077902: New API gettimezone
- From: Rich Felker <dalias at libc dot org>
- To: Paul Eggert <eggert at cs dot ucla dot edu>
- Cc: P J P <pj dot pandit at yahoo dot co dot in>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Date: Wed, 30 Apr 2014 15:31:08 -0400
- Subject: Re: [PING^2] RFC [PATCH] BZ#1077902: New API gettimezone
- Authentication-results: sourceware.org; auth=none
- References: <1397469748 dot 42212 dot YahooMailNeo at web192405 dot mail dot sg3 dot yahoo dot com> <1398146221 dot 72442 dot YahooMailNeo at web192403 dot mail dot sg3 dot yahoo dot com> <1398755742 dot 94004 dot YahooMailNeo at web192405 dot mail dot sg3 dot yahoo dot com> <535F74EE dot 8010002 at redhat dot com> <1398775268 dot 92264 dot YahooMailNeo at web192405 dot mail dot sg3 dot yahoo dot com> <535FC11B dot 3000906 at cs dot ucla dot edu> <1398801168 dot 81041 dot YahooMailNeo at web192406 dot mail dot sg3 dot yahoo dot com> <5360378D dot 1060306 at cs dot ucla dot edu> <1398872997 dot 84757 dot YahooMailNeo at web192402 dot mail dot sg3 dot yahoo dot com> <53614148 dot 90603 at cs dot ucla dot edu>
On Wed, Apr 30, 2014 at 11:30:32AM -0700, Paul Eggert wrote:
> On 04/30/2014 08:49 AM, P J P wrote:
> >It sounds more of incorrect or buggy time zone file.
>
> No, that time zone file is not buggy. It's generated by the
> standard tzdata distribution, it uses the documented file layout,
> and many other time zone files are like it. For details, please see
> the tzfile man page.
>
> >TZ variable provides offsets which are added to the UTC times to
> >get the local time, right?
>
> That's basically right. (TZ also can provide leap-second info,
> which maps TAI to UTC, but let's ignore that for now.)
This is actually a bug. The TZ variable is not specified to modify the
behavior of functions that work with non-local time, and in fact
having gmtime return different results based on the TZ variable is
non-conforming.
Rich