diff options
Diffstat (limited to 'src/common.py')
-rw-r--r-- | src/common.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/common.py b/src/common.py index b71f84fc..6cd83248 100644 --- a/src/common.py +++ b/src/common.py @@ -264,7 +264,10 @@ def datetime_tuple(timestamp): """ timestamp = timestamp.split('.')[0] timestamp = timestamp.replace('-', '') - ret = datetime.strptime(timestamp, '%Y%m%dT%H:%M:%SZ') + try: + ret = datetime.strptime(timestamp, '%Y%m%dT%H:%M:%SZ') + except ValueError: # Support the deprecated format, XEP 0091 :( + ret = datetime.strptime(timestamp, '%Y%m%dT%H:%M:%S') # convert UTC to local time, with DST etc. dst = timedelta(seconds=time.altzone) ret -= dst |