comparison scripts/getan-report.py @ 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
comparison
equal deleted inserted replaced
403:f656d9370085 404:c272982799b5
80 80
81 args = parser.parse_args() 81 args = parser.parse_args()
82 l.debug(args) 82 l.debug(args)
83 83
84 if args.reportday: 84 if args.reportday:
85 report_range_start = \ 85 try:
86 datetime.datetime.strptime(args.reportday, "%Y-%m-%d") 86 report_range_start = \
87 datetime.datetime.strptime(args.reportday, "%Y-%m-%d")
88 except ValueError:
89 report_range_start = \
90 datetime.datetime.strptime(args.reportday, "%Y%m%d")
91
87 elif args.t: 92 elif args.t:
88 # start with today 00:00 93 # start with today 00:00
89 report_range_start = datetime.datetime.combine( 94 report_range_start = datetime.datetime.combine(
90 datetime.date.today(), datetime.time()) 95 datetime.date.today(), datetime.time())
91 else: 96 else:
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)