How can we convert custom timezone to normal(IANA) format timezone in getSchedule Api ?

phenom-test-one 1 Reputation point
2023-01-02T07:35:29.087+00:00

While fetching events using graph getSchedule Api , we are getting events along with timezone. Sometimes timezone is custom timezone. How can we get actual offset timezone from custom timezone?

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

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 36,891 Reputation points
    2023-01-02T08:44:25.437+00:00

    Hi @phenom-test-one

    You can add the Prefer: outlook.timezone header to the request to specify the time zone for the event start and end times in the response.

    GET https://graph.microsoft.com/v1.0/me/events/{event id}  
    Prefer: outlook.timezone="Pacific Standard Time"  
    

    In general, the timeZone property can be set to any of the time zones currently supported by Windows, as well as the additional time zones supported by the calendar API.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.