]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/MsgTime.pm
msgtime: parse 3-digit years properly
[public-inbox.git] / lib / PublicInbox / MsgTime.pm
index 4295e87389f9ccdfbb7b399c774420ddf7c18812..c67a41fff2effa6b2bfbc163040936350f5a4d8c 100644 (file)
@@ -47,6 +47,9 @@ sub msg_date_only ($) {
        my ($ts, $zone);
        foreach my $d (@date) {
                $zone = undef;
+               # Y2K problems: 3-digit years
+               $d =~ s!([A-Za-z]{3}) (\d{3}) (\d\d:\d\d:\d\d)!
+                       my $yyyy = $2 + 1900; "$1 $yyyy $3"!e;
                $ts = eval { str2time($d) };
                if ($@) {
                        my $mid = $hdr->header_raw('Message-ID');