I’m working on an Outlook use case where we need to fetch meetings for a user within a specific start and end datetime using the Microsoft Graph API.
Challenge
When calling the CalendarView endpoint, the Graph API requires both start and end datetime values. If no time offset is included, it defaults to UTC.
For example, for Eastern Standard Time (EST), the offset should be UTC-5 hours.
The question is: How can we dynamically pass the correct offset based on the user’s timezone?
What we’ve tried
- We attempted to format the datetime using the Moveworks DSL
Format_Timefunction, but this requires the timezone in IANA format. - From the Graph API, we only get the user’s timezone in Windows format (e.g.,
Eastern Standard Time). - Is there a recommended way to convert Windows timezone values to IANA format within DSL, so that we can correctly set the datetime offset when calling the Graph API?
Examples:
- Windows timezone:
Eastern Standard Time - IANA timezone:
America/New_York
Link of the API we are using: List calendarView - Microsoft Graph v1.0 | Microsoft Learn
Any guidance or best practices would be really helpful!
Thanks in Advance!