forked from indymedia/epicyon
Parse date
parent
828ed9f9e8
commit
c3ef87683e
|
@ -11,6 +11,7 @@ import time
|
|||
import os
|
||||
import commentjson
|
||||
from datetime import datetime
|
||||
from dateutil.parser import parse
|
||||
from shutil import copyfile
|
||||
from pprint import pprint
|
||||
from person import personBoxJson
|
||||
|
@ -1226,9 +1227,10 @@ def individualPostAsHtml(baseDir: str, \
|
|||
publishedStr=postJsonObject['object']['published']
|
||||
if '.' not in publishedStr:
|
||||
datetimeObject = datetime.strptime(publishedStr,"%Y-%m-%dT%H:%M:%SZ")
|
||||
publishedStr=datetimeObject.strftime("%a %b %d, %H:%M")
|
||||
else:
|
||||
publishedStr=publishedStr.replace('T',' ').split('.')[0]
|
||||
datetimeObject = parse(publishedStr)
|
||||
publishedStr=datetimeObject.strftime("%a %b %d, %H:%M")
|
||||
footerStr='<span class="'+timeClass+'">'+publishedStr+'</span>\n'
|
||||
|
||||
announceStr=''
|
||||
|
|
Loading…
Reference in New Issue