This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PING^2] RFC [PATCH] BZ#1077902: New API gettimezone


> On Tuesday, 29 April 2014 3:16 PM, Carlos O'Donell <> wrote:
> The current implementation isn't robust in that the POSIX TZ at the end
> of the zone file might not be enough to define the timezone completely.

  True. TZ variable does not include all the entries from a time zone file. Nonetheless, the TZ string at the end of a zone file does work well because it defines the required offsets from UTC for both standard and daylight savings time. When it does not define such offsets, the default of 1 hour is defined and documented. And for cases wherein the TZ string is absent from a zone file, fall-back to UTC is well reasonable too.

IMO, TZ variable is not expected to hold the 'complete' time zone definition from a zone file. Its syntax does not allow for that:

       std offset dst [offset],start[/time],end[/time]

It could be treated as a minimal time zone definition to be used in circumstances wherein the complete elaborate definition is not accessible. In that sense, the current patch does offer an acceptable working solution.

> You need to set TZ to a file e.g. TZ=Country/City where possible and
> assume in your use-case that the chroot has an updated set of zones
> installed that match. You want to use the TZ file format because it allows
> a correct implementation by using all the data in the zone files. The POSIX
> TZ is insufficient to be correct all the time.

  Agreed. But the 'TZ=Region/City' definition requires that the said file is accessible from the chroot(2) jail. It is not always feasible.

> Can you sketch out the tzalloc-style API and propse it?

  Sure! I'll look into it and get back asap. Is such API expected to make the 'complete' time zone definition available to its consumers?

Thank you.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]