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:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user