An all-day event in outlook calendar in IST is not converted to UTC while fetching the events using graph API with prefer in headers as 'Prefer': 'outlook.timezone="UTC"', while other events do. Why?

Jessal John Mammen 0 Reputation points
2023-03-22T06:54:38.8733333+00:00

In an outlook calendar with timeZone IST, an all-day event is created on 22nd March and a normal event is created for 8:00AM to 8:30 AM on the same day.

When the events are listed using graph API to list the events with:
'Prefer': 'outlook.timezone="UTC"',

for normal event it is listed as,
start:{dateTime: 2023-03-22T02:30:00.0000000, timeZone: "UTC"} .
But for the all-day event, it is shown as
*start:{dateTime: 2023-03-22T00:00:00.0000000, timeZone: "UTC"}. Similarly for the end too.
*
Why is it like that? Why is an all-day event not getting converted to the preferred timeZone while it shows the timeZone as UTC in the response?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,830 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2023-03-22T13:36:57.61+00:00

    Hello Jessal John Mammen,

    Thanks for reaching out!

    While listing events using Microsoft Graph API, it is an expected behavior that the startDateTime and endDateTime will return in UTC format.

    Adding Prefer: outlook.timezone="India Standard Time" into the Request Header will provide the response in IST Time Zone.

    Please refer to the below screenshots:
    outlook_prefer

    Hope this helps.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have further questions about this answer, please click "Comment".


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.