forked from indymedia/epicyon
Date format check
This commit is contained in:
1 parent
c937cbdac8
commit
944fa554e7
1 file changed
+6
-2
@@ -214,8 +214,12 @@ def htmlNewswire(baseDir: str, newswire: {}, nickname: str, moderator: bool,
|
||||
item[0] = item[0].split('CDATA[')[1]
|
||||
if ']' in item[0]:
|
||||
item[0] = item[0].split(']')[0]
|
||||
publishedDate = \
|
||||
datetime.strptime(dateStr, "%Y-%m-%d %H:%M:%S%z")
|
||||
try:
|
||||
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")
|
||||
|
||||
dateStrLink = dateStr.replace('T', ' ')
|
||||
|
||||
Reference in new issue
Block a user