3

When I receive a user request I would like to respond with a date with the user timezone. Actually, I can only respond with server TZ

StErMi
  • 5,389
  • 5
  • 48
  • 71
  • Provide the code where you're responding with the date, so we can help you. – Marcos Casagrande Apr 15 '18 at 21:14
  • 1
    The key to this question is that it’s about responding to a dialogflow webhook request. So the question is really “how do i get the user’s time zone out of a dialogflow webhook request?” – Robert Levy Apr 15 '18 at 22:24

2 Answers2

1

Unfortunately, DialogFlow doesn’t make it easy by simply telling g you what timezone the user is coming from. The best you can do is ask the user for their timezone and then save that to do date/time adjustments in future responses.

This can be optimized a bit for users accessing your agent through Google Assistant by using the new permissions API. See https://chatbotsmagazine.com/personalize-google-assistant-skill-with-user-data-328f5e0860a0

Robert Levy
  • 28,747
  • 6
  • 62
  • 94
0

If your user responds to your agent with the parameter of @sys.date-time type, you will receive in your fulfillment the value in ISO-8601 format like "2019-12-17T22:00:00+02:00". The last 6 characters represent a timezone offset. You can use it and calculate the target local time of your users.

Sergey Y.
  • 51
  • 6