From c937cbdac870ecb55cb66babf51a412132a63e3c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 22 Nov 2020 15:33:11 +0000 Subject: [PATCH] timedelta import --- newswire.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/newswire.py b/newswire.py index 8ccef7a79..86ff29356 100644 --- a/newswire.py +++ b/newswire.py @@ -11,6 +11,7 @@ import requests from socket import error as SocketError import errno from datetime import datetime +from datetime import timedelta from collections import OrderedDict from utils import firstParagraphFromString from utils import isPublicPost @@ -208,7 +209,7 @@ def xml2StrToDict(baseDir: str, domain: str, xmlStr: str, try: publishedDate = \ datetime.strptime(pubDate, "%a, %d %b %Y %H:%M:%S EST") - hoursAdded = datetime.timedelta(hours=5) + hoursAdded = timedelta(hours=5) publishedDate = publishedDate + hoursAdded postFilename = '' votesStatus = [] @@ -341,7 +342,7 @@ def atomFeedToDict(baseDir: str, domain: str, xmlStr: str, try: publishedDate = \ datetime.strptime(pubDate, "%a, %d %b %Y %H:%M:%S EST") - hoursAdded = datetime.timedelta(hours=5) + hoursAdded = timedelta(hours=5) publishedDate = publishedDate + hoursAdded postFilename = '' votesStatus = []