[erlang-patches] Fix calendar:local_time_to_universal_time_dst/2 bug of return value -1 from mktime

Björn Gustavsson <>
Wed Feb 10 15:26:31 CET 2010

2010/2/10 Björn Gustavsson <>:
> On Wed, Feb 10, 2010 at 6:13 AM, Kenji Rikitake <> wrote:
>> I am struggling to merge FreeBSD port patches into my GitHub repository.
>> This one is a long-standing fix which is proposed and fixed by
>> Paul Guyot. I do not claim any credit for this patch.
>> This patch has been tested for at least a year in FreeBSD port of Erlang (lang/erlang).
>> git fetch git://github.com/jj1bdx/otp.git local_to_univ
> Thanks! Will include in pu.

Result from our review:

We don't want the change in calendar.erl.

The documentation says that local_time_to_universal_time_dst/1
returns an empty list for a time that does not exist. We don't want
the same return value for a valid time that cannot be handled because
of an implementation detail.

We may consider using the patch for erl_time_sup.c, if you can
provide some information to show that it is really needed. Note
that the BIF does a range check of its arguments. Are there some
values of the arguments that slip through the range check and
cause mktime() to return -1?

Since such a change is considered a bug fix, we can accept
it after the feature freeze today.

Björn Gustavsson, Erlang/OTP, Ericsson AB

More information about the erlang-patches mailing list