mirror of https://github.com/openspug/spug
fix:修复阿里云主机同步时UTC解析错误
parent
5f6a93cac3
commit
62e14c86d9
|
@ -48,7 +48,7 @@ def parse_utc_date(value):
|
||||||
return None
|
return None
|
||||||
s_format = '%Y-%m-%dT%H:%M:%S%z'
|
s_format = '%Y-%m-%dT%H:%M:%S%z'
|
||||||
if len(value) == 17:
|
if len(value) == 17:
|
||||||
s_format = '%Y-%m-%dT%H:%M%z'
|
s_format = '%Y-%m-%dT%H:%MZ'
|
||||||
date = datetime.strptime(value, s_format)
|
date = datetime.strptime(value, s_format)
|
||||||
return date.astimezone().strftime('%Y-%m-%d %H:%M:%S')
|
return date.astimezone().strftime('%Y-%m-%d %H:%M:%S')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue