TZ determination

Bruce Fitzsimons Bruce@REDACTED
Thu Mar 13 11:11:09 CET 2003


Hi Per,

----- Original Message -----
From: "Per Hedeland" <per@REDACTED>
To: <Bruce@REDACTED>
Cc: <erlang-questions@REDACTED>
Sent: Wednesday, March 12, 2003 1:31 AM
Subject: Re: TZ determination


> Hm, why the sudden interest in time zones (well, second question in two
> weeks:-)

I'm making the Yaws logging more Apache compliant so log analysers will work
over it. It works well with Analog now.

> needs to do such things... You want to watch out for non-integral-hours
> offsets though:
>
> $ env TZ=Australia/Adelaide date +%z
> +1030
> $ env TZ=Australia/Adelaide erl -noshell -s foo przone -s erlang halt
> +1050

I eventually decided that inets must be doing something similar, looked,
and it is. Almost exactly the same except without the bug you've noted. :-)

> >Suggestions on how to better drive io_lib would be appreciated too - I
ended
> >up with 0-100 under some formatting/padding combinations, which seemed
like
> >a bug.
>
> Doesn't seem to happen with what you have now - though maybe
> io*:format() is "overkill", you could do something like

4> io_lib:format("~6..0w", [-33]).
[["000","-33"]]

Which looks buggy, but it may be explainable.

>
>   L = integer_to_list(trunc(abs(Val))),
>   "+" ++ lists:nthtail(length(L), "0000") ++ L.

Better...

> (at least you don't have to read the io man page to figure out what it
> does:-).

Even after reading it, I'm still confused. Every time I need to use for some
special formatting it it takes me a few cycles to make it work. Is it just
me?

Thanks for the comments.

/Bruce





More information about the erlang-questions mailing list