From 7560ee00293de59a41492f185f86ababd2bf9a14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kroupa?= Date: Sun, 7 Jan 2024 11:45:12 +0100 Subject: [PATCH] Update datetime format string WIP sad update format --- pykeepass/baseelement.py | 2 +- pykeepass/pykeepass.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pykeepass/baseelement.py b/pykeepass/baseelement.py index 6e4e96f0..2ca238fa 100644 --- a/pykeepass/baseelement.py +++ b/pykeepass/baseelement.py @@ -19,7 +19,7 @@ def __init__(self, element, kp=None, icon=None, expires=False, self._element.append(E.IconID(icon)) current_time_str = self._kp._encode_time(datetime.now(timezone.utc)) if expiry_time: - expiry_time_str = self._kp._encode_time(expiry_time) + expiry_time_str = self._kp._encode_time(expiry_time.astimezone(timezone.utc)) else: expiry_time_str = current_time_str diff --git a/pykeepass/pykeepass.py b/pykeepass/pykeepass.py index f0131c1c..93eb71e9 100644 --- a/pykeepass/pykeepass.py +++ b/pykeepass/pykeepass.py @@ -28,7 +28,7 @@ BLANK_DATABASE_FILENAME = "blank_database.kdbx" BLANK_DATABASE_LOCATION = os.path.join(os.path.dirname(os.path.realpath(__file__)), BLANK_DATABASE_FILENAME) BLANK_DATABASE_PASSWORD = "password" -DT_ISOFORMAT = "%Y-%m-%dT%H:%M:%S%z" +DT_ISOFORMAT = "%Y-%m-%dT%H:%M:%S%fZ" class PyKeePass(): """Open a KeePass database @@ -795,7 +795,7 @@ def _encode_time(self, value): struct.pack('