1

I created a Teams bot receiving the messages. When a user sends a message to my bot, can I get the time zone in which the user is?

1 Answers1

0

Unfortunately, you cannot know the timezone, but you can know the time offset. This is a typical request payload (I removed the unrelated properties)

{
    "timestamp": "2019-06-17T14:32:04.956Z",
    "localTimestamp": "2019-06-18T00:32:04.956+10:00",
    "entities": [
        {
            "locale": "en-US",
            "country": "US",
        }
    ],
    "locale": "en-US"
}

You can use localTimestamp to get user's local time and offset, but not timezone. You can find the country and locale information as well, but again, no timezone.

TonyX
  • 409
  • 2
  • 4