AWSDateTime无法解析ISO 8601格式,这是一个错误吗?

0

【以下的问题经过翻译处理】 概括

"2019-04-09T23:25:27+09:00" 是有效的ISO 8601日期时间表示法。

“2019-04-09T23:25:27+0900”(无冒号时区)我认为也是有效的(https://en.wikipedia.org/wiki/ISO_8601 这么说,但这只是我的猜测,因为我没有 ISO 8601 标准规范 pdf https://www.iso.org/iso-8601-date-and-time-format.html。)

AWSDateTime 接受前者,但拒绝后者。

我认为这是错误,因为 https://docs.aws.amazon.com/appsync/latest/devguide/scalars.html#awsdatetime 说:

AWSDateTime标量类型表示有效的扩展ISO 8601 DateTime字符串。

如何重现

  1. 使用 Dynamodb 后端设置 AppSync
  2. 使用 AWSDateTime 作为 GraphQL 类型的一部分
  3. 在 dynamodb 控制台中为 AWSDateTime 插入值为“2019-04-09T23:25:27+0900”的行 4.在AppSync控制台查询获取行
  4. 出现无效行值等错误

P.S

我没有检查 AWSTime 但它可能有同样的问题。

profile picture
EXPERTE
gefragt vor 5 Monaten21 Aufrufe
1 Antwort
0

【以下的回答经过翻译处理】 目前,AWS AppSync要求时区中包含冒号。根据我们的文档,"时区偏移必须要么是Z(表示UTC时区),要么是格式为±hh:mm:ss"(https://docs.aws.amazon.com/appsync/latest/devguide/scalars.html#awsdatetime)

profile picture
EXPERTE
beantwortet vor 5 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen