comparison 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
comparison
equal deleted inserted replaced
3952:9badc46c5481 3953:8179cff7ef5c
175 @return: datetime converted to unix time 175 @return: datetime converted to unix time
176 """ 176 """
177 if with_time: 177 if with_time:
178 dt = xmpp_datetime.parse_datetime(xmpp_date_str) 178 dt = xmpp_datetime.parse_datetime(xmpp_date_str)
179 else: 179 else:
180 dt = xmpp_datetime.parse_date(xmpp_date_str) 180 d = xmpp_datetime.parse_date(xmpp_date_str)
181 181 dt = datetime.datetime.combine(d, datetime.datetime.min.time())
182 return time.mktime(dt.timetuple()) 182
183 return dt.timestamp()
183 184
184 185
185 def generatePassword(vocabulary=None, size=20): 186 def generatePassword(vocabulary=None, size=20):
186 """Generate a password with random characters. 187 """Generate a password with random characters.
187 188