summaryrefslogtreecommitdiff
path: root/webapp.py
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2019-03-06 08:18:38 +0100
committerHelmut Grohne <helmut@subdivi.de>2019-03-06 08:18:38 +0100
commit876c5cd5db04768d3738486c835d61301d26ec61 (patch)
treebada6354dc43da94fb4f1c4ce314c029a824c244 /webapp.py
parent3c2d0f0b8855f4f35149c75ba7dff68ca3b66bc9 (diff)
downloadcrossqa-876c5cd5db04768d3738486c835d61301d26ec61.tar.gz
webapp: parse rounded timestamps
Diffstat (limited to 'webapp.py')
-rw-r--r--webapp.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/webapp.py b/webapp.py
index b9558cd..9e69a18 100644
--- a/webapp.py
+++ b/webapp.py
@@ -90,7 +90,10 @@ src_template = """<!DOCTYPE html>
@app.template_filter("sqltimestamp")
def sqltimestamp_filter(s):
- return datetime.datetime.strptime(s, "%Y-%m-%d %H:%M:%S.%f")
+ try:
+ return datetime.datetime.strptime(s, "%Y-%m-%d %H:%M:%S.%f")
+ except ValueError:
+ return datetime.datetime.strptime(s, "%Y-%m-%d %H:%M:%S")
@app.template_filter("formatts")
def formatts_filter(ts):