[erlang-questions] Time zone

Ulf Wiger ulf@REDACTED
Mon Dec 11 13:14:12 CET 2006

> Hi,
> Is there a way to get the time zone configured on a machine without
> resorting to hacks.
> It'll be nice to have something like:
> calendar:time_zone().
> OR
> erlang:system_info(time_zone).

On a unix system, you can do this today:

11> os:getenv("TZ").
13> time().
15> os:putenv("TZ","UWT+5").
16> time().

... you get the idea.


for more info on the TZ variable.

Timezone handling is really tricky. We never could come up with a better
solution than setting the TZ variable directly in the VM environment.

Ulf W

More information about the erlang-questions mailing list