Skip to content
This repository was archived by the owner on Feb 26, 2026. It is now read-only.

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

Open
perlpilot wants to merge 2 commits intogbarr:masterfrom
perlpilot:rt84075
Open

RT84075: Date::Parse::str2time maps date in 1963 to 2063#8
perlpilot wants to merge 2 commits intogbarr:masterfrom
perlpilot:rt84075

Conversation

@perlpilot
Copy link

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.

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.
@Koan-Bot
Copy link

Migration Notice

This repository is no longer actively maintained. The official source has moved to atoomic/perl-TimeDate.

This PR's changes have already been incorporated into the new repository. No migration needed.


🤖 Automated migration check by Kōan

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants