From 1ef03924c6cd3d8a3e6653c6add3b367b3da1011 Mon Sep 17 00:00:00 2001 From: Tim Stallard Date: Sun, 14 Jul 2024 18:01:03 +0100 Subject: [PATCH] fix for setting timezones on parsed timestamps --- backup/rotation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backup/rotation.py b/backup/rotation.py index b1587a8..85711dd 100644 --- a/backup/rotation.py +++ b/backup/rotation.py @@ -69,7 +69,7 @@ def get_snapshots(dataset: str, schname: str) -> list[datetime]: dates = [] for snap in snaps: try: - dates.append(datetime.strptime(snap, f"backup-{schname}-%Y-%m-%d")) # noqa: DTZ007 + dates.append(datetime.strptime(snap, f"backup-{schname}-%Y-%m-%d").replace(tzinfo=TIMEZONE)) except ValueError: # snapshot didn't match our scheme, ignore pass