2024-06-02 07:59:26 发布
网友
我有这样一个模式:
"foo": {"type": "string", "format": "time"}
我尝试了new (new Date()).toISOString()它有以下格式:
new (new Date()).toISOString()
错误:
jsonschema.exceptions.ValidationError: '2018-06-12T08:59:01.135Z' is not a 'time'
{ "format": "time" }使用RFC-3339第5.6节“Internet日期/时间格式”。在
{ "format": "time" }
http://json-schema.org/latest/json-schema-validation.html#rfc.section.7.3.1https://tools.ietf.org/html/rfc3339#section-5.6
您可以转换日期^{cd1>}
new Date().toJSON()
MDN docs
{ "format": "time" }
使用RFC-3339第5.6节“Internet日期/时间格式”。在http://json-schema.org/latest/json-schema-validation.html#rfc.section.7.3.1https://tools.ietf.org/html/rfc3339#section-5.6
您可以转换日期^{cd1>}
MDN docs
相关问题 更多 >
编程相关推荐