From c19be40619ab3a9331d8cad71f633690122415ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andra=C5=BE=20Cuderman?= Date: Thu, 21 Oct 2021 10:27:23 +0200 Subject: [PATCH] fix(IDENT-3532): Update record time stamp ISO format --- aries_cloudagent/messaging/tests/test_util.py | 2 +- aries_cloudagent/messaging/util.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aries_cloudagent/messaging/tests/test_util.py b/aries_cloudagent/messaging/tests/test_util.py index 23614b511e..c1a7e7c82b 100644 --- a/aries_cloudagent/messaging/tests/test_util.py +++ b/aries_cloudagent/messaging/tests/test_util.py @@ -55,7 +55,7 @@ def test_format(self): tests = { datetime( 2019, 5, 17, 20, 51, 19, 519437, tzinfo=timezone.utc - ): "2019-05-17 20:51:19.519437Z", + ): "2019-05-17T20:51:19.519437Z", now: now, } for datetime_val, expected in tests.items(): diff --git a/aries_cloudagent/messaging/util.py b/aries_cloudagent/messaging/util.py index d100d4adab..a5e28b15a1 100644 --- a/aries_cloudagent/messaging/util.py +++ b/aries_cloudagent/messaging/util.py @@ -21,7 +21,7 @@ def datetime_to_str(dt: Union[str, datetime]) -> str: dt: May be a string or datetime to allow automatic conversion """ if isinstance(dt, datetime): - dt = dt.replace(tzinfo=timezone.utc).isoformat(" ").replace("+00:00", "Z") + dt = dt.replace(tzinfo=timezone.utc).isoformat().replace("+00:00", "Z") return dt