houseabsolute / Time-Local

Efficiently compute time from local and GMT time
https://metacpan.org/release/Time-Local/
Other
4 stars 11 forks source link

50 year window for two digit year breaks tests in 2020. #12

Closed matthewpersico closed 4 years ago

matthewpersico commented 4 years ago

Typo

matthewpersico commented 4 years ago

'70' now means 2010, not 1970, breaks https://github.com/gbarr/perl-TimeDate/blob/master/t/getdate.t#L159

autarch commented 4 years ago

I'm not sure what tests you're referring to. The Time::Local test suite still passes for me. If you're talking about other distros, there's nothing I can do about that. While I think the whole heuristic around 2 digit years was a huge mistake, I can't change that. There is the *_modern API if you want to avoid those issues.

ChGeorgi commented 4 years ago

Try use Time::Local;

print timegm(1,1, 1, 1, 0, 70); i get Can't handle date (1, 1, 1, 1, 0, 170) at E:\time1.pl line 3

autarch commented 4 years ago

@ChGeorgi - I'm not sure what that has to do with what matthew reported, but what you're seeing there is an issue related to your Perl's maximum integer size on older Perls, I believe.

I'm going to close this since the original issue is a bug in TimeDate, not Time::Local.

eserte commented 4 years ago

Just for reference: the TimeDate distribution already has a bug report for this: https://rt.cpan.org/Ticket/Display.html?id=124509