Author: asterix Date: 2008-06-13 17:34:55 +0200 (Fri, 13 Jun 2008) New Revision: 9796
Modified: trunk/src/common/helpers.py Log: remove Z char (meaning UTC) in received timestamp. fixes #3796
Modified: trunk/src/common/helpers.py =================================================================== --- trunk/src/common/helpers.py 2008-06-13 02:18:16 UTC (rev 9795) +++ trunk/src/common/helpers.py 2008-06-13 15:34:55 UTC (rev 9796) @@ -1162,10 +1162,13 @@ 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')