0
votes

I'm using mail rest api for fetching messages. Value of property 'receivedDateTime' in response is showing time +4 than it is being showed in outlook.office365.com. That is, in mail web client if the received time is showing 'Mon 12:01 pm', 'receivedDateTime' in rest api response is showing '16:01', 4 more, means '4:01 pm'.

I tried below with different time-zones but results are always same:

Prefer: outlook.timezone="'Some' Standard Time"

But it is not working.

I want to receive same received time as it is showing in mail web client.

1

1 Answers

0
votes

Microsoft Graph gives times in Coordinated Universal Time (https://en.wikipedia.org/wiki/Coordinated_Universal_Time) - that's what the "Z" in the timestamp indicates.

To get the user's timezone, call GET /users/{id|userPrincipalName}/mailboxSettings/timeZone. You can use this to adjust the times from Graph.

As far as I know you cannot receive times from Graph in any time zone other than UTC.


https://docs.microsoft.com/en-us/graph/api/user-get-mailboxsettings

https://docs.microsoft.com/en-us/graph/api/resources/message?view=graph-rest-1.0#properties