From: Eric Wong Date: Tue, 13 Dec 2016 03:10:12 +0000 (+0000) Subject: nntp: avoid useless use of strftime X-Git-Tag: v1.0.0~138 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=a629927ec2ac4f41022ab1d2b1897cbc0e463e3e;p=public-inbox.git nntp: avoid useless use of strftime There's no need to use strftime if we'll be converting the date by hand, anyways. --- 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; } }