]> git.donarmstrong.com Git - debbugs.git/commitdiff
if there is an offset which is too large, set the TZ to UTC
authorDon Armstrong <don@donarmstrong.com>
Tue, 8 Aug 2017 19:39:48 +0000 (12:39 -0700)
committerDon Armstrong <don@donarmstrong.com>
Tue, 8 Aug 2017 19:39:48 +0000 (12:39 -0700)
Debbugs/DB/Load.pm

index e768df97609195a90a8209a847861685c83ae46d..d3019830e7b48d02e1e4482523c66829c7ac85b6 100644 (file)
@@ -385,8 +385,12 @@ sub load_bug_log {
                                subject => $subject
                               });
            eval {
-               $m->sent_date(DateTime::Format::Mail->
-                             parse_datetime($entity->head->get('Date',0)));
+               my $date = DateTime::Format::Mail->
+                    parse_datetime($entity->head->get('Date',0));
+                if (abs($date->offset) >= 60 * 60 * 12) {
+                    $date = $date->set_time_zone('UTC');
+                }
+                $m->sent_date($date);
            };
            my $spam = $entity->head->get('X-Spam-Status',0)//'';
            if ($spam=~ /score=([\d\.]+)/) {