[xmlparser] Fix date extraction when using old format

This commit is contained in:
nemunaire 2015-04-02 19:57:26 +02:00
parent 8bcceb641f
commit 2644d1bc02

View File

@ -85,8 +85,8 @@ class ModuleState:
except ValueError: except ValueError:
while True: while True:
try: try:
import time import calendar, time
return time.strptime(source[:19], "%Y-%m-%d %H:%M:%S").replace(tzinfo=timezone.utc) return datetime.utcfromtimestamp(calendar.timegm(time.strptime(source[:19], "%Y-%m-%d %H:%M:%S"))).replace(tzinfo=timezone.utc)
except ImportError: except ImportError:
pass pass