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

strptime can't parse years before 1900 #56

Open
choroba opened this issue Jan 21, 2022 · 0 comments · May be fixed by #67
Open

strptime can't parse years before 1900 #56

choroba opened this issue Jan 21, 2022 · 0 comments · May be fixed by #67

Comments

@choroba
Copy link
Contributor

choroba commented Jan 21, 2022

'Time::Piece'->strptime('1899-12-31', '%Y-%m-%d')

fails with

Error parsing time at /home/choroba/opensource/Time-Piece/blib/lib/Time/Piece.pm line 481.

But the library handles the date just fine, e.g.

'Time::Piece'->strptime('1900-01-01', '%Y-%m-%d') - Time::Seconds::ONE_DAY;  # Sun Dec 31 00:00:00 1899

If I ran git bisect correctly, it was working OK before 1.17.

choroba added a commit to choroba/Time-Piece that referenced this issue Nov 23, 2023
They could be produced by e.g. subtracting something from 1900-01-01,
but parsing year < 1900 failed.

Also add a test to verify it works.

Fixes Dual-Life#56.
@choroba choroba linked a pull request Nov 23, 2023 that will close this issue
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 a pull request may close this issue.

1 participant