This is the mail archive of the libc-alpha@sourceware.org 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


   Hello Russ,

Thank you for the explanation.

> On Thursday, 1 May 2014 10:38 PM, Russ Allbery <eagle@eyrie.org> wrote:
> The TZ string is only applicable to times *after* the last transition time
> stored in the file.  In other words, if the file has any specific data for
> a given time period, that data overrides the TZ string.  The TZ string is
> supposed to be used only as a fallback for times that are beyond the date
> range represented in the database file.

  Ah, I see. Well, then the new API could be used to return the most suitable value amongst all available.
 

> Any other approach will produce incorrect local times.  In some areas,

> such as the US, the inaccuracies will only be for historical times.  In
> others, they may be inaccurate even for current or near-future times.
> 
> Unless I'm mistaken and am missing some representational power in the
> format, I believe the other POSIX time zone settings cannot accurately
> represent the complexity of real-world time zones.
> 
> Now, obviously, if you can make simplifying assumptions for a specific
> application, you may be able to use other TZ settings and be correct
> within the problem domain of your application.  For example, if you only
> care about forward-looking timestamps in the America/Los_Angeles zone, you
> can use a fairly simple TZ rule and be as accurate as the full database
> would be (namely, accurate until the US Congress changes daylight saving
> time again).  There are probably many applications that can make such
> simplifying assumptions.  But I'm dubious that glibc can do so.
 
  Hmmn, I understand your concern.

The thing is, we are seeking to rely on the fall-back TZ string option because there is none other more suitable for the case in point, ie. chroot(2) jail. Wherein, the system's time zone data is not readily accessible. It that, glibc is not making simplifying assumptions, but merely facilitating it, if the users want to do so.

---
Regards
   -Prasad
http://feedmug.com


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