Correct RFC822 for dates
This commit is contained in:
parent
47ef046e55
commit
dc9e9a10af
@ -27,6 +27,7 @@ import subprocess
|
|||||||
import re
|
import re
|
||||||
import locale
|
import locale
|
||||||
import markdown
|
import markdown
|
||||||
|
from email import utils
|
||||||
from hashlib import md5
|
from hashlib import md5
|
||||||
|
|
||||||
from functools import cmp_to_key
|
from functools import cmp_to_key
|
||||||
@ -770,7 +771,7 @@ rss += ("\t<channel>"
|
|||||||
"\t\t<copyright>"+params["COPYRIGHT"]+"</copyright>\n"
|
"\t\t<copyright>"+params["COPYRIGHT"]+"</copyright>\n"
|
||||||
"\t\t<webMaster>"+params["WEBMASTER"]+"</webMaster>\n"
|
"\t\t<webMaster>"+params["WEBMASTER"]+"</webMaster>\n"
|
||||||
"\t\t<lastBuildDate>" +
|
"\t\t<lastBuildDate>" +
|
||||||
strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime())+"</lastBuildDate>\n")
|
utils.formatdate(mktime(gmtime()))+"</lastBuildDate>\n")
|
||||||
|
|
||||||
|
|
||||||
# Generate header (except title) + index file + rss file
|
# Generate header (except title) + index file + rss file
|
||||||
@ -805,10 +806,11 @@ for i, article in enumerate(["gen/"+x[4:-5]+".gen" for x in last_articles]):
|
|||||||
articles_header += "</li>"
|
articles_header += "</li>"
|
||||||
|
|
||||||
articles_index += content
|
articles_index += content
|
||||||
date_rss = strftime("%a, %d %b %Y %H:%M:%S +0000",
|
date_rss = utils.formatdate(mktime(gmtime(mktime(datetime.
|
||||||
gmtime(mktime(datetime.datetime.strptime(date,
|
datetime.
|
||||||
|
strptime(date,
|
||||||
"%d%m%Y-%H%M")
|
"%d%m%Y-%H%M")
|
||||||
.timetuple())))
|
.timetuple()))))
|
||||||
|
|
||||||
rss += ("\t\t<item>\n"
|
rss += ("\t\t<item>\n"
|
||||||
"\t\t\t<title>"+remove_tags(title)+"</title>\n"
|
"\t\t\t<title>"+remove_tags(title)+"</title>\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user