diff options
author | Helmut Grohne <helmut@subdivi.de> | 2019-03-06 08:18:38 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2019-03-06 08:18:38 +0100 |
commit | 876c5cd5db04768d3738486c835d61301d26ec61 (patch) | |
tree | bada6354dc43da94fb4f1c4ce314c029a824c244 /webapp.py | |
parent | 3c2d0f0b8855f4f35149c75ba7dff68ca3b66bc9 (diff) | |
download | crossqa-876c5cd5db04768d3738486c835d61301d26ec61.tar.gz |
webapp: parse rounded timestamps
Diffstat (limited to 'webapp.py')
-rw-r--r-- | webapp.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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): |