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