I am working on a website that posts events throughout the year. We offer an .ICS download so visitors can add the events to their calendars.
We recently discovered that visitors are reporting the time to be off (plus or minus one hour depending on their location) for events that occur after March 11. Basically, this is the “true” time that the event will occur given the time-shift, but the issue is that the event was scheduled for a specific time that should not be adjusted.
How does one get around this issue? All my attempts to compensate by adding or subtracting an hour have resulted in it breaking for either East coast or West coast.
Possible related question here:
https://stackoverflow.com/questions/9484447/scheduling-events-and-daylight-savings-time
UPDATE: here is the code I am using:
// Create calendar and add the desired timezone
DDay.iCal.iCalendar iCal = new DDay.iCal.iCalendar();
var targetTimeZone = TimeZoneInfo.FindSystemTimeZoneById(tzid);
iCal.AddTimeZone(targetTimeZone);
// Create the event and add it to the calendar
DDay.iCal.Event evt = iCal.Create<DDay.iCal.Event>();
// Adjust the start/end date by one hour if the dates/times fall under daylight savings in the target timezone
if (targetTimeZone.IsDaylightSavingTime(endDt))
endDt = endDt.AddHours(-1);
evt.DTEnd = new iCalDateTime(endDt, tzid);
if (targetTimeZone.IsDaylightSavingTime(startDt))
startDt = startDt.AddHours(-1);
evt.DTStart = new iCalDateTime(startDt, tzid);
The solution was to omit the timezone completely from the iCalendar and use UTC date/times.