diff sat/tools/utils.py @ 3879:46930301f0c1

tools: renamed module `sat.tools.datetime` to `date.tools.xmpp_datetime` to avoid conflict with Python's standard lib
author Goffi <goffi@goffi.org>
date Wed, 31 Aug 2022 13:18:56 +0200
parents 32087d7c25d4
children 022ae35a9d82
line wrap: on
line diff
--- a/sat/tools/utils.py	Wed Aug 31 13:11:26 2022 +0200
+++ b/sat/tools/utils.py	Wed Aug 31 13:18:56 2022 +0200
@@ -34,7 +34,7 @@
 from twisted.internet import defer
 from sat.core.constants import Const as C
 from sat.core.log import getLogger
-from sat.tools.datetime import format_date, format_datetime
+from sat.tools import xmpp_datetime
 
 log = getLogger(__name__)
 
@@ -157,7 +157,10 @@
         datetime.timezone.utc
     )
 
-    return format_datetime(dtime) if with_time else format_date(dtime.date())
+    return (
+        xmpp_datetime.format_datetime(dtime) if with_time
+        else xmpp_datetime.format_date(dtime.date())
+    )
 
 
 def generatePassword(vocabulary=None, size=20):