From a629927ec2ac4f41022ab1d2b1897cbc0e463e3e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 13 Dec 2016 03:10:12 +0000 Subject: nntp: avoid useless use of strftime There's no need to use strftime if we'll be converting the date by hand, anyways. --- lib/PublicInbox/NNTP.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/NNTP.pm') diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index b7143ff3..9408ffb9 100644 --- a/lib/PublicInbox/NNTP.pm +++ b/lib/PublicInbox/NNTP.pm @@ -250,8 +250,8 @@ sub parse_time ($$;$) { ($YYYY, $MM, $DD) = unpack('A4A2A2', $date); } else { # legacy clients send YYMMDD ($YYYY, $MM, $DD) = unpack('A2A2A2', $date); - if ($YYYY > strftime('%y', @now)) { - my $cur_year = $now[5] + 1900; + my $cur_year = $now[5] + 1900; + if ($YYYY > $cur_year) { $YYYY += int($cur_year / 1000) * 1000 - 100; } } -- cgit v1.2.3-24-ge0c7