Fix time offset error when saving

This commit is contained in:
Daniel Schick 2026-01-14 16:08:26 +01:00
parent bbd96c47ed
commit d63a26fff9

View File

@ -22,8 +22,8 @@ def _format_datetime(value):
return None
if isinstance(value, datetime.datetime):
if value.tzinfo is None or value.tzinfo.utcoffset(value) is None:
return value.isoformat() + "Z"
return value.isoformat()
return value.astimezone().replace(tzinfo=None).isoformat()
return value
def obj_dict(obj):