[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:
while True:
try:
import time
return time.strptime(source[:19], "%Y-%m-%d %H:%M:%S").replace(tzinfo=timezone.utc)
import calendar, time
return datetime.utcfromtimestamp(calendar.timegm(time.strptime(source[:19], "%Y-%m-%d %H:%M:%S"))).replace(tzinfo=timezone.utc)
except ImportError:
pass