Check that offset exists

main
Bob Mottram 2020-11-22 20:37:08 +00:00
parent 758380dade
commit a998c0b321
1 changed files with 2 additions and 1 deletions

View File

@ -191,7 +191,8 @@ def parseFeedDate(pubDate: str) -> str:
pubDateStr = None
if publishedDate:
offset = publishedDate.utcoffset()
publishedDate = publishedDate - offset
if offset:
publishedDate = publishedDate - offset
# convert local date to UTC
publishedDate = publishedDate.replace(tzinfo=timezone.utc)
pubDateStr = str(publishedDate)