always pass four digit years to Time::Local::timelocal #14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.