[erlang-questions] Setting TZ variable

Ulf Wiger ulf.wiger@REDACTED
Thu Dec 2 16:45:59 CET 2010


Hmm…

At least it works on  my Macbook:

uwiger$ erl
Erlang R14B (erts-5.8.1) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.8.1  (abort with ^G)
1> os:getenv("TZ").
false
2> time().
{16,42,42}
3> os:putenv("TZ","GMT").
true
4> time().               
{15,43,2}
5> os:putenv("TZ","EST").
true
6> time().               
{10,43,33}


BR,
Ulf W


On 2 Dec 2010, at 15:59, Alexey Romanov wrote:

> I've tried to follow the advice given by Ulf Wiger in this old thread:
> http://www.erlang.org/pipermail/erlang-questions/2006-December/024291.html
> 
> However, it doesn't work for me:
> 
> aromanov@REDACTED:~/workspace/gmcontroller$ erl
> Erlang R14B (erts-5.8.1) [source] [smp:2:2] [rq:2] [async-threads:0]
> [hipe] [kernel-poll:false]
> 
> Eshell V5.8.1  (abort with ^G)
> 1> os:getenv("TZ").
> false
> 2> time().
> {17,49,40}
> 3> os:putenv("TZ", "GMT").
> true
> 4> os:getenv("TZ").
> "GMT"
> 5> time().
> {17,50,8}
> 
> Am I doing something wrong?
> 
> Setting TZ in the shell does work (but isn't suitable for my purposes):
> 
> aromanov@REDACTED:~/workspace/gmcontroller$ TZ=GMT erl
> Erlang R14B (erts-5.8.1) [source] [smp:2:2] [rq:2] [async-threads:0]
> [hipe] [kernel-poll:false]
> 
> Eshell V5.8.1  (abort with ^G)
> 1> os:getenv("TZ").
> "GMT"
> 2> time().
> {14,50,39}
> 
> Yours, Alexey Romanov
> 
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
> 

Ulf Wiger, CTO, Erlang Solutions, Ltd.
http://erlang-solutions.com





More information about the erlang-questions mailing list