AWS AppSync管道解析器函数中的IST时间。

0

【以下的问题经过翻译处理】 我有一个流水线解析器,应该自动从aws appsync的$util.time中获取当前的IST日期时间,

$util.time.nowISO8601()返回UTC时间,它工作得很好,但是我应该在应用前端设置时间转换

当我尝试使用$util.time.nowFormatted("yyyy-MM-dd HH:mm:ssZ", "Asia/Kolkatta")时,出现了错误 "message": "Cannot return null for non-nullable type: 'AWSDateTime' within parent"

profile picture
EXPERTE
gefragt vor 6 Monaten59 Aufrufe
1 Antwort
0

【以下的回答经过翻译处理】 我相信根本原因是ZoneId中的拼写错误。根据实用程序文档,格式基于DateTimeFormatter,它使用时区数据库(TZDB)ID来表示时区。根据这个文档,应该是Asia/CalcuttaAsia/Kolkata。您可以在这里找到有用的时区列表。

profile picture
EXPERTE
beantwortet vor 6 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