Skip to content

Fix bug when passing utc timestamps into httpd_util:rfc1123/1.#776

Merged
martincox merged 1 commit into
develop-2.2from
mcx/bugfix/date-conversion-stats
Feb 26, 2018
Merged

Fix bug when passing utc timestamps into httpd_util:rfc1123/1.#776
martincox merged 1 commit into
develop-2.2from
mcx/bugfix/date-conversion-stats

Conversation

@martincox

Copy link
Copy Markdown
Contributor

This function expects a localtime and throws an exception otherwise. This is evident when the clocks go forward for DST and a time falling in the skipped hour is passed into the function.

The fact that an exception is thrown is down to a bug in OTP which was patched in 20.1.

…unction

expects a localtime and throws an exception otherwise. This is evident when
the clocks go forward for DST and a time falling in the skipped hour is passed
into the function.

The fact that an exception is thrown is down to a bug in OTP which was patched
in 20.1.
@martincox

Copy link
Copy Markdown
Contributor Author

@russelldb @Vagabond @binarytemple-external needs a quick review / merge if anyone can spare a couple of mins?

@ghost

ghost commented Feb 21, 2018

Copy link
Copy Markdown

I don't have review rights, but I'll give it a +1

5> httpd_util:rfc1123_date(calendar:universal_time_to_local_time(DateTime)).
"Mon, 01 Jan 2018 00:00:00 GMT"
6> f(DateTime).                
ok
7> DateTime = {{2013, 9, 19}, {20, 51, 7}}.                                 
{{2013,9,19},{20,51,7}}
8> httpd_util:rfc1123_date(calendar:universal_time_to_local_time(DateTime)).
"Thu, 19 Sep 2013 20:51:07 GMT"

I guess from your commit message we can dump it later when everything is running on 20.2+ but that's the future, better to think in the present.

@ghost

ghost commented Feb 21, 2018

Copy link
Copy Markdown

fixes #775

@russelldb russelldb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM +1

@martincox
martincox merged commit 55943f8 into develop-2.2 Feb 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants