summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2022-07-12 12:54:35 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2022-07-12 12:54:35 +0200
commit78a5f792400feeccac91700509d9854afcfe1f90 (patch)
treecc45ed6a1eba2a255d9493b24a223b2293527a9f
parentfc63768cfc5bdd98c6e57a027b7006b6cbcb1366 (diff)
downloadslixmpp-78a5f792400feeccac91700509d9854afcfe1f90.tar.gz
slixmpp-78a5f792400feeccac91700509d9854afcfe1f90.tar.bz2
slixmpp-78a5f792400feeccac91700509d9854afcfe1f90.tar.xz
slixmpp-78a5f792400feeccac91700509d9854afcfe1f90.zip
XEP-0202: Remove usage of mini_dateutil
Like the previous commit, we now use the builtin datetime module always.
-rw-r--r--slixmpp/plugins/xep_0202/stanza.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/slixmpp/plugins/xep_0202/stanza.py b/slixmpp/plugins/xep_0202/stanza.py
index 7d09de50..faa230f9 100644
--- a/slixmpp/plugins/xep_0202/stanza.py
+++ b/slixmpp/plugins/xep_0202/stanza.py
@@ -8,7 +8,6 @@ import datetime as dt
from slixmpp.xmlstream import ElementBase
from slixmpp.plugins import xep_0082
-from slixmpp.thirdparty import tzutc, tzoffset
class EntityTime(ElementBase):
@@ -87,7 +86,7 @@ class EntityTime(ElementBase):
seconds (positive or negative) to offset.
"""
time = xep_0082.time(offset=value)
- if xep_0082.parse(time).tzinfo == tzutc():
+ if xep_0082.parse(time).tzinfo == dt.timezone.utc:
self._set_sub_text('tzo', 'Z')
else:
self._set_sub_text('tzo', time[-6:])
@@ -111,6 +110,6 @@ class EntityTime(ElementBase):
date = value
if not isinstance(value, dt.datetime):
date = xep_0082.parse(value)
- date = date.astimezone(tzutc())
+ date = date.astimezone(dt.timezone.utc)
value = xep_0082.format_datetime(date)
self._set_sub_text('utc', value)