EWS managed API getting attendee timezone with daylight savings details

523 views Asked by At

I use the GetUserAvailability operation to get the attendee availability details I am getting AttendeeAvailability, which contains a WorkingHours property, which itself includes TimeZone. BUt the problem is it gives only offset. If daylight savings are there or not how would i know? How to find the actual timezone string or how to know whether the offset is with daylight savings or without daylight savings?

To explain further:

I want to show the timezone and time of attendees of a meeting in scheduler. I get the timezone from AttendeeAvailability's WorkingHours property. It doesn't give the actual timezone string and gives the offset from GMT. So I have a mapping internally for mapping the Timezones to the offset and show in tooltip, the timezones, attendee possibly belongs to. But to do this, I should know whether Daylight savings is in effect or not because EST5EDT would be without daylight savings UTC - 5, but with daylight savings would be UTC - 4. So if I get offset as -5, I won't know whether to show EST5EDT or not in the tooltip because of daylight savings. So I want to either get the timezone string of attendees or have to know whether DST is in effect during that part of the year.

GetUserAvailabilityResults freeBusyResults = service.GetUserAvailability(
    attendees, 
    new TimeWindow(meetingStartDateTime, meetingEndDateTime), 
    AvailabilityData.FreeBusy,
    myOptions
);
if (availability != null && availability.WorkingHours != null && availability.WorkingHours.TimeZone != null)
{
    TimeZoneInfo tzi = (TimeZoneInfo)availability.WorkingHours.TimeZone;

    listAttendee[i].TimeZone = tzi;
    listAttendee[i].StandardNameTZ = GetStandardNameTZ(tzi);
}
0

There are 0 answers