]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/MsgTime.pm
msgtime: assume +0000 if TZ missing when using Date::Parse
[public-inbox.git] / lib / PublicInbox / MsgTime.pm
index 8eee9a7586922c0fb302421c4c195b4540793fd2..8703d7bc0a78293dbe4735e34c5a339ad8cffb6c 100644 (file)
@@ -104,7 +104,8 @@ sub str2date_zone ($) {
                # off is the time zone offset in seconds from GMT
                my ($ss,$mm,$hh,$day,$month,$year,$off) =
                                        Date::Parse::strptime($date);
-               return undef unless(defined $off);
+               return unless defined($year);
+               $off //= 0;
 
                # Compute the time zone from offset
                my $sign = ($off < 0) ? '-' : '+';