NLP timezone issue

252 views Asked by At

Currently i am using Bot Framework with Node for my chat bot and i am using API AI as my Natural Language Processing.

My question is, let say the user replied with "yesterday" or "today" or "tomorrow" and it is base on the server time. Now, it will go wrong if a person in Australia says today at 6 AM in the morning and their time which is in GMT will still be previous day and this gives a wrong date.

May i have suggestion on how do i solve this timezone issue?

1

There are 1 answers

4
mattcarrollcode On

Each API.AI agent has a default time zone setting which can be altered in your agents settings (documentation here) which will be used to determine the meaning of user's date/time queries like "tomorrow" and "yesterday" and "3pm":

enter image description here

If you're using API.AI's /query API you can send the timezone parameter in the request JSON to indicate what timezone the user you are sending the request on behalf of is in.