From 5f2dbb263d1c49d26247a8bd000acf1e04709ca6 Mon Sep 17 00:00:00 2001 From: dougiesquire Date: Thu, 10 Aug 2023 13:05:45 +1000 Subject: [PATCH] allow get_timeinfo to return subhr --- src/access_nri_intake/source/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/access_nri_intake/source/utils.py b/src/access_nri_intake/source/utils.py index 52c6db2f..27ef0d93 100644 --- a/src/access_nri_intake/source/utils.py +++ b/src/access_nri_intake/source/utils.py @@ -70,8 +70,11 @@ def _todate(t): frequency = f"{months}mon" elif dt.days >= 1: frequency = f"{dt.days}day" + elif dt.seconds >= 3600: + hours = round(dt.seconds / 3600) + frequency = f"{hours}hr" else: - frequency = f"{dt.seconds // 3600}hr" + frequency = "subhr" start_time = ts.strftime(time_format) end_time = te.strftime(time_format)