]> Sergey Matveev's repositories - public-inbox.git/commitdiff
nntp: handle 2-digit year "70" properly
authorEric Wong <e@80x24.org>
Wed, 1 Jan 2020 03:28:22 +0000 (03:28 +0000)
committerEric Wong <e@80x24.org>
Wed, 1 Jan 2020 03:49:32 +0000 (03:49 +0000)
Time::Local has the concept of a "rolling century" which is
defined at 50 years on either side of the current year.  Since
it's now 2020 and >50 years since the Unix epoch, the year "70"
gets interpreted by Time::Local as 2070-01-01 instead of
1970-01-01.

Since NNTP servers are unlikely to store messages from the
future, we'll feed 4-digit year to Time::Local::{timegm,timelocal}
and hopefully not have to worry about things until Y10K.

This fixes test failures on t/v2writable.t and t/nntpd.t since
2020-01-01.


No differences found