Skip to content
Snippets Groups Projects
Commit e807c056 authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

remove Z char (meaning UTC) in received timestamp. fixes #3796

parent e4aa0de7
No related branches found
No related tags found
No related merge requests found
......@@ -1162,10 +1162,13 @@ def datetime_tuple(timestamp):
Because of various datetime formats are used the following exceptions
are handled:
- Optional milliseconds appened to the string are removed
- Optional Z (that means UTC) appened to the string are removed
- XEP-082 datetime strings have all '-' cahrs removed to meet
the above format.'''
timestamp = timestamp.split('.')[0]
timestamp = timestamp.replace('-', '')
timestamp = timestamp.replace('z', '')
timestamp = timestamp.replace('Z', '')
from time import strptime
return strptime(timestamp, '%Y%m%dT%H:%M:%S')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment