问题描述
我正在使用lex内置插槽AMAZON.DATE。问题是,当用户键入今天时,它会将时间解释为当地时间。我认为是lex托管于N.Virginia的时间。
I am using lex built-in slot AMAZON.DATE. the problem is when user types 'today' it interprets time as local time. I think it is N.Virginia time where lex is hosted.
例如,当用户今天输入时(今天在澳大利亚,今天是11月1日),但是lex发送的值为31/10。
For example, when user types today (today is 1 Nov in Australia) but lex sends the value as 31/10.
有没有一种方法可以在lex中设置其他时区?
Is there a way we can set a different time zone in the lex ?
推荐答案
要设置用于解析日期的时区,使其相对于用户的时区,请使用x-amz-lex:time-zone请求属性。如果未在x-amz-lex:time-zone属性中指定时区,则默认值为America / New York。
To set the time zone used to resolve dates so that it is relative to the user's time zone, use the x-amz-lex:time-zone request attribute. If you do not specify a time zone in the x-amz-lex:time-zone attribute, the default is America/New York.
请查看文档
这篇关于Lex AMAZON.DATE问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!