Fix time offset error when saving
This commit is contained in:
parent
bbd96c47ed
commit
d63a26fff9
@ -22,8 +22,8 @@ def _format_datetime(value):
|
|||||||
return None
|
return None
|
||||||
if isinstance(value, datetime.datetime):
|
if isinstance(value, datetime.datetime):
|
||||||
if value.tzinfo is None or value.tzinfo.utcoffset(value) is None:
|
if value.tzinfo is None or value.tzinfo.utcoffset(value) is None:
|
||||||
return value.isoformat() + "Z"
|
return value.isoformat()
|
||||||
return value.isoformat()
|
return value.astimezone().replace(tzinfo=None).isoformat()
|
||||||
return value
|
return value
|
||||||
|
|
||||||
def obj_dict(obj):
|
def obj_dict(obj):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user