From dc6ed7aa66896f5df2b5903831f9773c4238d8a0 Mon Sep 17 00:00:00 2001 From: 1maple1 <160027655+1maple1@users.noreply.github.com> Date: Tue, 17 Sep 2024 14:27:24 +0000 Subject: [PATCH] Fix datetime utc compatibility --- brewtils/plugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/brewtils/plugin.py b/brewtils/plugin.py index 33de5098..729d76c3 100644 --- a/brewtils/plugin.py +++ b/brewtils/plugin.py @@ -11,7 +11,7 @@ import appdirs from box import Box -from datetime import datetime, UTC +from datetime import datetime, timezone from packaging.version import Version from requests import ConnectionError as RequestsConnectionError @@ -388,7 +388,7 @@ def _hook(exc_type, exc_value, traceback): @staticmethod def get_timestamp(add_time: int = None): - current_timestamp = int(datetime.now(UTC).timestamp()) + current_timestamp = int(datetime.now(timezone.utc).timestamp()) if add_time: return current_timestamp + add_time return current_timestamp