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

RT84075: Date::Parse::str2time maps date in 1963 to 2063 #8

Open
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
1 participant
@perlpilot

perlpilot commented Mar 2, 2015

Adds a test and a fix for this bug. The guess in RT that the bug is triggered in years that are 50 years in the past is good. str2time makes calls to timegm/timelocal which have some guessing logic for the century when given 2 digit years. To fix the bug, we keep track of whether or not we were given a 4 digit year and if so, pass a 4 digit year to timegm/timelocal so it doesn't guess.

perlpilot added some commits Mar 1, 2015

[strptime] Parse out century if specified
If we've been given a year that's got the century attached (i.e., the
year is > 1900), store the century.  Then use this information to defeat
the guessing behavior of timegm.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment