Creating a calendar event with Graph API shows wriong time and timezone

Johan Stenkvist 5 Reputation points
2023-05-08T18:47:18.47+00:00

I have a React application where I create and update calendar events via Microsoft Graph API.

Everything works as expected except for one part.
The time and timezone are shown wrong when viewing an event in Outlook.

In the views "Day", "Work week", "Week" and "Month" it shows correctly, but when entering the calendar event to view details, both time and timezone are wrong.

This is the event object I am saving via Microsoft Grap API:

{
  subject: "Event title",
  body: {
	content: "Description",
	contentType: "text"
  },
  start: {
	dateTime: "Mon May 29 2023 21:30:00 GMT+0200 (Central European Summer Time)",
	timeZone: "Europe/Stockholm",
  },
  end: {
	dateTime: "Mon May 29 2023 22:30:00 GMT+0200 (Central European Summer Time)",
	timeZone: "Europe/Stockholm",
  },
  organizer: {
	emailAddress: {
	  address: "******@hotmail.com",
	  name: "Jxxx",
	},
  },
  attendees: [
	{
	  emailAddress: {
		address: "******@hotmail.com",
		name: "Jxxx",
	  },
	  type: "required",
	},
  ],
  responseRequested: true,
}

This is how it looks in "Week" view in Outlook:

User's image

And this is how it looks when I open the calendar event:
User's image

Outlook | Windows | Classic Outlook for Windows | For business
Microsoft Security | Microsoft Graph
{count} vote

Your answer

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