[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:
|
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
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user