[erlang-questions] Setting TZ variable
Thu Dec 2 20:46:16 CET 2010
# Ulf Wiger 2010-12-02:
> At least it works on my Macbook: [... it works ...]
Well, localtime(3) is specified (in POSIX.1) to behave as if it calls
tzset(3) every time, but no such promise is made for localtime_r(3).
So on some platforms that provide localtime_r(3), the tzset(3) call
in erts/emulator/sys/unix/sys.c:erl_sys_init() may be the only time
TZ variable is ever taken into consideration.
Unfortunately, there doesn't seem to be a standard API for conversions
between different timezones in the C library -- it has zoneinfo around
and enough functions to process it, but is simply too greedy to export
Not that this actually helps anyone, but perhaps it explains different
behaviours on different platforms...
More information about the erlang-questions