changeset 404:c272982799b5

scripts/getan-report.py: also accepts YYYYMMDD as reportdate.
author Bernhard Reiter <bernhard@intevation.de>
date Fri, 03 Feb 2017 15:01:06 +0100
parents f656d9370085
children 150180e972d3
files scripts/getan-report.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/getan-report.py	Fri Feb 03 14:57:32 2017 +0100
+++ b/scripts/getan-report.py	Fri Feb 03 15:01:06 2017 +0100
@@ -82,8 +82,13 @@
     l.debug(args)
 
     if args.reportday:
-        report_range_start = \
-            datetime.datetime.strptime(args.reportday, "%Y-%m-%d")
+        try:
+            report_range_start = \
+                datetime.datetime.strptime(args.reportday, "%Y-%m-%d")
+        except ValueError:
+            report_range_start = \
+                datetime.datetime.strptime(args.reportday, "%Y%m%d")
+
     elif args.t:
         # start with today 00:00
         report_range_start = datetime.datetime.combine(
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)