On Fri, Dec 22, 2023 at 8:33 AM <to...@tuxteam.de> wrote: > > On Fri, Dec 22, 2023 at 07:26:37PM +0700, Max Nikulin wrote: > > [...] > > /etc/localtime is a global setting. Its change may affect all users not > > having explicit TZ. Something better than libc is required for an > > application (especially multithread one) that need to deal with time in > > multiple time zones. > > Yes. Libc's (POSIX, for that) interface is pretty bad. It effectively > limits one to one time zone per libc instance.
I've found lack of per-thread timezones and libc's inability to convert time between timezones a bigger problem than other issues, like explicitly setting a timezone for a process. The use case is, an appointment needs to be added to a database with UTC time, but the sender of the appointment uses localtime+timezone offset, like 1:00 PM PST or 1:00 PM EST. Trying to convert the localtime+timezone time to UTC (or other timezone) on a server in a thread is a real nightmare. Also see <https://sourceware.org/pipermail/libc-help/2021-January/005652.html>. Jeff