date format

merge-requests/30/head
Bob Mottram 2021-09-07 20:09:41 +01:00
parent a79d2b191d
commit a1901609bf
1 changed files with 3 additions and 1 deletions

View File

@ -192,9 +192,9 @@ def parseFeedDate(pubDate: str) -> str:
formats = ("%a, %d %b %Y %H:%M:%S %z",
"%a, %d %b %Y %H:%M:%S EST",
"%a, %d %b %Y %H:%M:%S UT",
"%a, %d %b %Y %H:%M:%S GMT",
"%Y-%m-%dT%H:%M:%SZ",
"%Y-%m-%dT%H:%M:%S%z")
publishedDate = None
for dateFormat in formats:
if ',' in pubDate and ',' not in dateFormat:
@ -207,6 +207,8 @@ def parseFeedDate(pubDate: str) -> str:
continue
if 'EST' not in pubDate and 'EST' in dateFormat:
continue
if 'GMT' not in pubDate and 'GMT' in dateFormat:
continue
if 'EST' in pubDate and 'EST' not in dateFormat:
continue
if 'UT' not in pubDate and 'UT' in dateFormat: