[xmlparser] Fix date extraction when using old format
This commit is contained in:
parent
8bcceb641f
commit
2644d1bc02
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user