Error in httpd_util:rfc1123_date

Paul Davis <>
Mon Jan 18 22:27:25 CET 2010

It would appear that depending on timezone the following call to
rfc1123_date breaks with a badarg:

1> httpd_util:rfc1123_date(erlang:localtime()).
** exception error: bad argument
     in function erlang:universaltime_to_localtime/1
        called as erlang:universaltime_to_localtime({{1969,12,31},{23,59,59}})
     in call from calendar:local_time_to_universal_time_dst/1
     in call from httpd_util:rfc1123_date/1

Seeing as that's 1 second before 12:00 AM Jan 1st, 1970 I'm guessing
its a miscalculation somewhere.

This has been demonstrated in the time zones:

Western Indonesian Time
And Arabian Standard Time
East Africa Time

A bit of digging turned up [1] which seems like it might be related.

Paul Davis


More information about the erlang-bugs mailing list