This is the mail archive of the libc-help@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: RFC [PATCH] BZ#1077902: New API gettimezone


Carlos O'Donell wrote:

So the answer is "Use Boost.Date_Time?"

That's no answer, as Boost.Date_Time doesn't provide the requested functionality.

it is a flaw in the API not to provide
a way for the application to both query and set the timezone.

But there is a way: get and set the TZ environment variable. True, this doesn't let you get at the contents of /etc/localtime when TZ is unset; but the simple solution is to not rely on /etc/localtime, and to always set TZ.

While I agree that using UTC simplifies things, and that it may
be the case that wide-spread use of UTC will fix these problems,

Not "will fix". *Has* fixed. It's what people have been doing for *decades*, and it *works*.

I don't see using UTC as an acceptable solution for all users

People who want to run non-UTC servers (which is a bad idea) can set TZ. Problem solved.

Is something like tzget() really a bad idea?

Something like that *might* be implemented. But doing it right would be a lot of work for a small benefit. There are far more-pressing problems in the time zone API, such as, why isn't there a thread-safe way to set and get the time zone? If you want to work on improving this area of glibc, please work on *that*. That's a *real* need, and there's existing practice (NetBSD).


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