<div dir="ltr">That may work but it's really not suitable for lots of calculations. It might be even better to use a hardcoded set of offsets or bite the bullet and parse the zoneinfo files myself.<br><br>What is the best way to create bindings to the C functions that provide this functionality in libc? Is it worth it to create a linked in driver for this? What is the simplest way to create C bindings to lightweight functions that have a very low risk of crashing the Erlang VM?<br>
<br><br><div class="gmail_quote">On Thu, Sep 18, 2008 at 5:03 PM, Taavi Talvik <span dir="ltr"><<a href="mailto:taavi@uninet.ee">taavi@uninet.ee</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d"><br>
On Sep 18, 2008, at 10:18 PM, Juan Jose Comellas wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
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?<br>
<br>
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.<br>
</blockquote>
<br></div>
os:cmd("date args..").<br>
<br>
It is reasonably easy to run existing external tools from erlang and capture results.<br>
Reimplementing everything probably does not make sense.<br>
<br>
best regards,<br><font color="#888888">
taavi<br>
</font></blockquote></div><br></div>