diff sat/tools/utils.py @ 3953:8179cff7ef5c

tools (utils): fix `parse_xmpp_date` timezone: rel 381
author Goffi <goffi@goffi.org>
date Fri, 28 Oct 2022 18:47:17 +0200
parents 022ae35a9d82
children 5a42c7842556
line wrap: on
line diff
--- a/sat/tools/utils.py	Fri Oct 28 18:47:17 2022 +0200
+++ b/sat/tools/utils.py	Fri Oct 28 18:47:17 2022 +0200
@@ -177,9 +177,10 @@
     if with_time:
         dt = xmpp_datetime.parse_datetime(xmpp_date_str)
     else:
-        dt = xmpp_datetime.parse_date(xmpp_date_str)
+        d = xmpp_datetime.parse_date(xmpp_date_str)
+        dt = datetime.datetime.combine(d, datetime.datetime.min.time())
 
-    return time.mktime(dt.timetuple())
+    return dt.timestamp()
 
 
 def generatePassword(vocabulary=None, size=20):