From 35187aebdf97e49b5e4d696e0e459454e58ced6d Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 24 Mar 2021 12:37:03 +0100 Subject: [PATCH] LdapServer: fix formating naive date/datetime --- LdapServer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LdapServer.py b/LdapServer.py index cd984f8..4a844c8 100644 --- a/LdapServer.py +++ b/LdapServer.py @@ -365,7 +365,7 @@ def format_datetime(value, from_timezone=None, to_timezone=None, naive=None): to_timezone = dateutil.tz.tzlocal() elif isinstance(to_timezone, str): to_timezone = pytz.timezone(to_timezone) - to_value = from_value.astimezone(to_timezone) + to_value = from_value.astimezone(to_timezone) if not naive else from_value datestring = to_value.strftime('%Y%m%d%H%M%S%z') if datestring.endswith('+0000'): datestring = datestring.replace('+0000', 'Z')