[erlang-questions] Timezone calculations

Taavi Talvik <>
Thu Sep 18 22:03:22 CEST 2008


On Sep 18, 2008, at 10:18 PM, Juan Jose Comellas wrote:

> I need to perform time calculations based on arbitrary (user- 
> supplied) timezones and I haven't found anything in Erlang/OTP that  
> lets me determine the offset (in minutes or seconds) that a timezone  
> has against UTC. The calendar module only supports converting times  
> from UTC into the local timezone and the other way around, but what  
> if what I want is to convert a time to another timezone that is not  
> my local one?
>
> I'd prefer a portable solution, but even if there is an easy way to  
> access the Olson/zoneinfo tz database on Linux that would be  
> acceptable.

os:cmd("date args..").

It is reasonably easy to run existing external tools from erlang and  
capture results.
Reimplementing everything probably does not make sense.

best regards,
taavi



More information about the erlang-questions mailing list