diff --git a/pre-commit.py b/pre-commit.py index 78256cd..f2c2c3b 100755 --- a/pre-commit.py +++ b/pre-commit.py @@ -27,6 +27,7 @@ import subprocess import re import locale import markdown +from email import utils from hashlib import md5 from functools import cmp_to_key @@ -770,7 +771,7 @@ rss += ("\t" "\t\t"+params["COPYRIGHT"]+"\n" "\t\t"+params["WEBMASTER"]+"\n" "\t\t" + - strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime())+"\n") + utils.formatdate(mktime(gmtime()))+"\n") # 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 += "" articles_index += content - date_rss = strftime("%a, %d %b %Y %H:%M:%S +0000", - gmtime(mktime(datetime.datetime.strptime(date, - "%d%m%Y-%H%M") - .timetuple()))) + date_rss = utils.formatdate(mktime(gmtime(mktime(datetime. + datetime. + strptime(date, + "%d%m%Y-%H%M") + .timetuple())))) rss += ("\t\t\n" "\t\t\t"+remove_tags(title)+"\n"