mirror of https://gitlab.com/bashrc2/epicyon
Date format check
parent
c937cbdac8
commit
944fa554e7
|
@ -214,8 +214,12 @@ def htmlNewswire(baseDir: str, newswire: {}, nickname: str, moderator: bool,
|
||||||
item[0] = item[0].split('CDATA[')[1]
|
item[0] = item[0].split('CDATA[')[1]
|
||||||
if ']' in item[0]:
|
if ']' in item[0]:
|
||||||
item[0] = item[0].split(']')[0]
|
item[0] = item[0].split(']')[0]
|
||||||
publishedDate = \
|
try:
|
||||||
datetime.strptime(dateStr, "%Y-%m-%d %H:%M:%S%z")
|
publishedDate = \
|
||||||
|
datetime.strptime(dateStr, "%Y-%m-%d %H:%M:%S%z")
|
||||||
|
except BaseException:
|
||||||
|
print('WARN: bad date format ' + dateStr)
|
||||||
|
continue
|
||||||
dateShown = publishedDate.strftime("%Y-%m-%d %H:%M")
|
dateShown = publishedDate.strftime("%Y-%m-%d %H:%M")
|
||||||
|
|
||||||
dateStrLink = dateStr.replace('T', ' ')
|
dateStrLink = dateStr.replace('T', ' ')
|
||||||
|
|
Loading…
Reference in New Issue