fix(api): standardize UTC datetime serialization to use 'Z' instead of '+00:00' to support some service

e.g. https://github.com/yaowan233/nonebot-plugin-osubot
This commit is contained in:
MingxuanGame
2025-09-14 04:58:42 +00:00
parent c4f002fd45
commit ca89ddf657

View File

@@ -13,7 +13,7 @@ class UTCBaseModel(BaseModel):
if isinstance(v, datetime):
if v.tzinfo is None:
v = v.replace(tzinfo=UTC)
return v.astimezone(UTC).isoformat()
return v.astimezone(UTC).isoformat().replace("+00:00", "Z")
return v