From 758380dadece513c7a3eff54ef6a0939d6ac4eed Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 22 Nov 2020 20:33:24 +0000 Subject: [PATCH] Calculate offset --- newswire.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/newswire.py b/newswire.py index 50beca8b..4c86ac59 100644 --- a/newswire.py +++ b/newswire.py @@ -190,7 +190,8 @@ def parseFeedDate(pubDate: str) -> str: pubDateStr = None if publishedDate: - publishedDate = publishedDate - publishedDate.utcoffset() + offset = publishedDate.utcoffset() + publishedDate = publishedDate - offset # convert local date to UTC publishedDate = publishedDate.replace(tzinfo=timezone.utc) pubDateStr = str(publishedDate)