Graph GetSchedule returns wrong time

Spencer Allen 1 Reputation point
2022-08-02T19:01:17.433+00:00

We are querying our users for "WorkingElsewhere" times. When we query an All Day Working Elsewhere event, the time starts at different times for those days.

Query being run: https://graph.microsoft.com/v1.0/me/calendar/microsoft.graph.getSchedule

Forcing timezone with headers: outlook.timezone="Central Standard Time"

For example when I query myself, it starts/ends at midnight.

"start": {
"dateTime": "2022-07-24T00:00:00.0000000",
"timeZone": "Central Standard Time"
},
"end": {
"dateTime": "2022-07-26T00:00:00.0000000",
"timeZone": "Central Standard Time"
}

When I query another user, their day starts at 19:00:

"start": {
"dateTime": "2022-07-24T19:00:00.0000000",
"timeZone": "Central Standard Time"
},
"end": {
"dateTime": "2022-07-25T19:00:00.0000000",
"timeZone": "Central Standard Time"
}

Everyone in our account is in the same time zone (CST) unless they are traveling.

Thanks,

Spencer

Microsoft Security Microsoft Graph
{count} votes

1 answer

Sort by: Most helpful
  1. AtulThorat-MSFT 391 Reputation points
    2022-08-04T16:36:00.297+00:00

    Hi @Spencer Allen ,

    Hope you are doing well.

    Thanks for sharing complete graph API request and response.

    As per documentation, calendar-getschedule, in response this api give the free/busy availability information for a collection of users, distributions lists, or resources (rooms or equipment) for a specified time period.

    So in your case when you query yourself, you have event in your calendar which starts at "2022-08-02T00:00:00.0000000" and
    ends at "2022-08-03T00:00:00.0000000"

    So you are getting response as

    "start": {
    "dateTime": "2022-07-24T00:00:00.0000000",
    "timeZone": "Central Standard Time"
    },
    "end": {
    "dateTime": "2022-07-26T00:00:00.0000000",
    "timeZone": "Central Standard Time"
    }

    While you query for another user, that user have event in there calendar which starts at "2022-07-24T19:00:00.0000000" and
    ends at "2022-07-25T19:00:00.0000000".

    So you are getting response as

    "start": {
    "dateTime": "2022-07-24T19:00:00.0000000",
    "timeZone": "Central Standard Time"
    },
    "end": {
    "dateTime": "2022-07-25T19:00:00.0000000",
    "timeZone": "Central Standard Time"
    }

    I am able to reproduce this case in my tenant also and this is expected behavior.

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

    0 comments No comments

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.