From 35d3d63368af82482cf4910626cd8f23cf46ad0e Mon Sep 17 00:00:00 2001 From: "Ed (ODSC)" Date: Mon, 23 Sep 2024 08:37:24 +0100 Subject: [PATCH] utils.py: Fix for Z timezone suffix in all python versions --- libcovebods/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcovebods/utils.py b/libcovebods/utils.py index 79f89f6..ff607ca 100644 --- a/libcovebods/utils.py +++ b/libcovebods/utils.py @@ -51,7 +51,7 @@ def parse_date_field(date_str): elif re.match(r"^[0-9]{4}-[0-9]{1,2}$", date_str): return datetime.datetime.strptime(date_str, "%Y-%m").date() else: - return datetime.datetime.fromisoformat(date_str).date() + return datetime.datetime.fromisoformat(date_str.replace('Z', '+00:00')).date() else: return None