diff options
author | Lance Stout <lancestout@gmail.com> | 2011-02-02 09:13:22 -0500 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2011-02-02 09:13:22 -0500 |
commit | de6170a13de2dbb3cbcfbf4a74b749f20b0cf061 (patch) | |
tree | b60043234119a3d215e0eca65913dd038167b551 /sleekxmpp/plugins/xep_0202.py | |
parent | 65931bb384aada922c5287a3ad3cc62d04d6e676 (diff) | |
parent | 8dbe6f65462ec9b1a0506a00316415996f4d53d8 (diff) | |
download | slixmpp-de6170a13de2dbb3cbcfbf4a74b749f20b0cf061.tar.gz slixmpp-de6170a13de2dbb3cbcfbf4a74b749f20b0cf061.tar.bz2 slixmpp-de6170a13de2dbb3cbcfbf4a74b749f20b0cf061.tar.xz slixmpp-de6170a13de2dbb3cbcfbf4a74b749f20b0cf061.zip |
Merge branch 'develop' into roster
Conflicts:
sleekxmpp/basexmpp.py
Diffstat (limited to 'sleekxmpp/plugins/xep_0202.py')
-rw-r--r-- | sleekxmpp/plugins/xep_0202.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sleekxmpp/plugins/xep_0202.py b/sleekxmpp/plugins/xep_0202.py index fe1191ea..3b31c97a 100644 --- a/sleekxmpp/plugins/xep_0202.py +++ b/sleekxmpp/plugins/xep_0202.py @@ -27,10 +27,12 @@ class EntityTime(ElementBase): interfaces = set(('tzo', 'utc'))
sub_interfaces = set(('tzo', 'utc'))
- #def get_utc(self): # TODO: return a datetime.tzinfo object?
+ #def get_tzo(self):
+ # TODO: Right now it returns a string but maybe it should
+ # return a datetime.tzinfo object or maybe a datetime.timedelta?
#pass
- def set_tzo(self, tzo): # TODO: support datetime.tzinfo objects?
+ def set_tzo(self, tzo):
if isinstance(tzo, tzinfo):
td = datetime.now(tzo).utcoffset() # What if we are faking the time? datetime.now() shouldn't be used here'
seconds = td.seconds + td.days * 24 * 3600
@@ -45,7 +47,7 @@ class EntityTime(ElementBase): # Returns a datetime object instead the string. Is this a good idea?
value = self._get_sub_text('utc')
if '.' in value:
- return datetime.strptime(value, '%Y-%m-%d.%fT%H:%M:%SZ')
+ return datetime.strptime(value, '%Y-%m-%dT%H:%M:%S.%fZ')
else:
return datetime.strptime(value, '%Y-%m-%dT%H:%M:%SZ')
|