about summary refs log tree commit homepage
path: root/lib/PublicInbox/MsgTime.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/MsgTime.pm')
-rw-r--r--lib/PublicInbox/MsgTime.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/PublicInbox/MsgTime.pm b/lib/PublicInbox/MsgTime.pm
index 58e11d72..7dec48ce 100644
--- a/lib/PublicInbox/MsgTime.pm
+++ b/lib/PublicInbox/MsgTime.pm
@@ -23,6 +23,10 @@ sub str2date_zone ($) {
         my $sign = ($off < 0) ? '-' : '+';
         my $hour = abs(int($off / 3600));
         my $min  = ($off / 60) % 60;
+
+        # deal with weird offsets like '-0420' properly
+        $min = 60 - $min if ($min && $off < 0);
+
         my $zone = sprintf('%s%02d%02d', $sign, $hour, $min);
 
         # "-1200" is the furthest westermost zone offset,