Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

always pass four digit years to Time::Local::timelocal #14

Merged
merged 4 commits into from
Oct 1, 2020

Conversation

plicease
Copy link
Member

@plicease plicease commented Oct 1, 2020

This is for #5

This change makes sure that four digit years are passed to timelocal unmolested. It was sort of doing the right thing by adding then subtracting 1900 to a year that already had four digits in it, but it is pretty confusing.

I am not changing the (intended) behavior of treating 9x and 0-89 as 199x and 20xx respectively. They are converted to four digit years before being passed into timelocal so we don't have to worry about the timelocal bug where the current year changes its interpretation of two digit years. Long term this interpretation is probably wrong, however, I don't have any examples where apache provides a two digit year, so the point may be moot, and in any-case I can't accurate test for the correct behavior. I've added appropriate comments in the code so the maintainer in 2090 can at least understand why I punted on this. Sorry!

I've included tests for four digit years between 1970 and 2500.

@plicease plicease changed the title Use apache in a docker for testing. always pass four digit years to Time::Local::timelocal Oct 1, 2020
@plicease plicease merged commit 1c6c90d into main Oct 1, 2020
@plicease plicease deleted the graham/apache-image branch October 1, 2020 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant