outlookcalendaricalendar

Difficulty with .ics calendar formatting


I'm creating a .ics calendar item in C# and sending it by email to go into an Outlook calendar. Basically, it's working, but the time I'm getting is generally 4 hours earlier than the time I'm specifying. I think I have the timezone elements set up right. I'm in the Eastern time zone and this is strictly an in-house system so all times will always be eastern US time zone.

Does anyone see what I'm doing wrong?

BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 16.0 MIMEDIR//EN
VERSION:2.0
METHOD:PUBLISH
BEGIN:VTIMEZONE
TZID:Eastern Standard Time
BEGIN:STANDARD
DTSTART:16011104T020000
RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=11
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010311T020000
RRULE:FREQ=YEARLY;BYDAY=2SU;BYMONTH=3
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
DESCRIPTION:Training class to inform about and prevent workplace harassment
DTSTAMP:20240202T153000Z
DTSTART;TZID="Eastern Standard Time":20240213T140000Z
DTEND;TZID="Eastern Standard Time":20240213T153000Z
SEQUENCE:0
SUMMARY;LANGUAGE=en-us:Workplace Harassment Prevention Training Class 
LOCATION:Building 2 room 149
TRANSP:OPAQUE
UID:69EEED22-E111-436C-9210-6B95000A55D5
END:VEVENT
END:VCALENDAR

Solution

  • The Z at the end of a date-time string implies UTC. The timezone will be ignored. It's also recommended to use the olson timezone ID for better support, so America/Toronto for eastern time for example.