Mercurial > libervia-backend
changeset 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 | 9badc46c5481 |
children | 1ab16449577b |
files | sat/tools/utils.py |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
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):