From a5291d41060194b56c694768bbf10306b7f61bd7 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 4 Oct 2020 23:12:27 +0100 Subject: [PATCH] Date format --- newswire.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/newswire.py b/newswire.py index 5324f2e2..ec0ba834 100644 --- a/newswire.py +++ b/newswire.py @@ -145,14 +145,15 @@ def getRSSfromDict(baseDir: str, newswire: {}, None, domainFull, 'Newswire', translate) for published, fields in newswire.items(): + published = published.replace('+00:00', 'Z') try: - pubDate = datetime.strptime(published, "%Y-%m-%dT%H:%M:%S+00:00") + pubDate = datetime.strptime(published, "%Y-%m-%dT%H:%M:%SZ") except BaseException: continue rssStr += '\n' rssStr += ' ' + fields[0] + '\n' rssStr += ' ' + fields[1] + '\n' - + rssDateStr = pubDate.strftime("%a, %d %b %Y %H:%M:%S UT") rssStr += ' ' + rssDateStr + '\n' rssStr += '\n'