Lex AMAZON.DATE issue

2019-07-23 20:18发布

问题:

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.

For example, when user types today (today is 1 Nov in Australia) but lex sends the value as 31/10.

Is there a way we can set a different time zone in the lex ?

回答1:

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.

Please have a look on documentation here