From ad40a2b5a67df5d9cac7051c34f1a3f7467e56dd Mon Sep 17 00:00:00 2001 From: OzzieIsaacs Date: Fri, 17 Feb 2017 18:22:08 +0100 Subject: [PATCH] Bugfix parsing publishing date with milliseconds (#114) --- cps/web.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/web.py b/cps/web.py index 1c16f6ae..c119de05 100755 --- a/cps/web.py +++ b/cps/web.py @@ -283,7 +283,7 @@ def mimetype_filter(val): @app.template_filter('formatdate') def formatdate(val): conformed_timestamp = re.sub(r"[:]|([-](?!((\d{2}[:]\d{2})|(\d{4}))$))", '', val) - formatdate = datetime.datetime.strptime(conformed_timestamp[:-5], "%Y%m%d %H%M%S") + formatdate = datetime.datetime.strptime(conformed_timestamp[:15], "%Y%m%d %H%M%S") return format_date(formatdate, format='medium',locale=get_locale())