From: Don Armstrong Date: Tue, 8 Aug 2017 19:39:48 +0000 (-0700) Subject: if there is an offset which is too large, set the TZ to UTC X-Git-Url: https://git.donarmstrong.com/?p=debbugs.git;a=commitdiff_plain;h=3bea92b28cbdee9bd8bf97eb996ad91f4ea4a4e5 if there is an offset which is too large, set the TZ to UTC --- diff --git a/Debbugs/DB/Load.pm b/Debbugs/DB/Load.pm index e768df9..d301983 100644 --- a/Debbugs/DB/Load.pm +++ b/Debbugs/DB/Load.pm @@ -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\.]+)/) {