I need build a intent detection service for global users. One issue that I currently have is that the datetime parameter parsing. For instance, a query can be like “I want to take vacation from tomorrow to the end of this week.” For the starting time is tomorrow, and snips-nlu engine detected the starting date is 2019-09-12, as expected. However, if the user is sending this request from a different country, and my server is running in US, and the current time is later afternoon, then “tomorrow” can mean a different date from user perspective. For instance, if the person is in Asian, the current date is already 2019-09-12, and “tomorrow” is 2019-09-13.
My question is, how can I include user’s timezone information when parsing the datetime slots?
There are a number of work around, for instance, set timezone environment variable, and cheat the system, but this may mess-up other queries running concurrently on the same server. Using lock is also not a good solution as we may have the risk of deal lock.
Any suggestion or hack for the time function?