Using ICal.net, I serialize a calendar using this code:
var calendarSerializer = new CalendarSerializer();
var attachmentContent = calendarSerializer.SerializeToString(myCalendar);
When I serialize a DateTime that's defined in UTC, 11:00 PM for example, I get this:
20240330T230000Z
When I serialize 12:00 AM Midnight, I get this:
VALUE=DATE:20240331
Which is confusing MS-Outlook when I import my calendar.
I need Midnight to serialize like any other DateTime, and I need it to include the timezone, so that it converts to local time correctly.
Here's the code I use to create my calendar object:
adding this:
forces the serializer to guarantee the presence of a time and a time zone, even if it's just "000000Z". This corrects the issues I was having when importing into MS-Outlook calendar.