none
How to get Time Zone ID from AttendeeAvailability using EWS APi 2.0? RRS feed

  • Question

  • I want to get the Time zone ID like "Pacific Standard Time" from the aa.WorkingHours.TimeZone.

    List<AttendeeInfo> attendees = new List<AttendeeInfo>();

                attendees.Add(
    new AttendeeInfo()

                {
                    SmtpAddress = user1@xyz.com,
                    AttendeeType =
    MeetingAttendeeType.Required

                });
      // Specify suggested meeting time options.
                AvailabilityOptions myOptions = new AvailabilityOptions();
                myOptions.MeetingDuration = 30;
                myOptions.MaximumNonWorkHoursSuggestionsPerDay = 0;
                myOptions.GoodSuggestionThreshold = 49;
                myOptions.MinimumSuggestionQuality = SuggestionQuality.Excellent;
                myOptions.RequestedFreeBusyView = FreeBusyViewType.FreeBusy;

                 //Return a set of suggested meeting times.
                GetUserAvailabilityResults results = service.GetUserAvailability(attendees,
                                                                             new TimeWindow(DateTime.Now.AddHours(18), DateTime.Now.AddHours(100)),
                                                                                 AvailabilityData.FreeBusyAndSuggestions,
                                                                                 myOptions);

      foreach (AttendeeAvailability aa in results.AttendeesAvailability)
                {
                    Console.WriteLine("Start Hours : {0}", aa.WorkingHours.StartTime.ToString());
                    Console.WriteLine("End Hours : {0}", aa.WorkingHours.EndTime.ToString());
                    Console.WriteLine("Time Zone : {0}", aa.WorkingHours.TimeZone.ToString());

                }


    I want to get the Time Zone ID name of meeting attendee from aa.WorkingHours.TimeZone like "Pacific Standard Time"
    TimeZone {Custom time zone}
    BaseUtcOffset {-08:00:00}
    DaylightName "Daylight time"
    StandardName "Standard time"
    SupportsDaylightSavingTime true

    It is very hard to know which time zone this information is displayed from the below two as there know where given Timezone name.
    (UTC-08:00) Baja California | Pacific Standard Time (Mexico) | -08:00:00
    (UTC-08:00) Pacific Time (US & Canada) | Pacific Standard Time | -08:00:00

    Also  for (UTC-03:30) from date like above it is very hard to interpret which time zone the information based on the offset

    (UTC-03:30) Newfoundland | Newfoundland Standard Time | -03:30:00

    (UTC-03:00) Brasilia | E. South America Standard Time | -03:00:00

    (UTC-03:00) Buenos Aires | Argentina Standard Time | -03:00:00

    (UTC-03:00) Cayenne, Fortaleza | SA Eastern Standard Time | -03:00:00

    (UTC-03:00) Greenland | Greenland Standard Time | -03:00:00

    (UTC-03:00) Montevideo | Montevideo Standard Time | -03:00:00

    (UTC-03:00) Salvador | Bahia Standard Time | -03:00:00

    Please advise how can I get the Time zone ID ?


    Varun Yadav

    Saturday, May 11, 2013 2:47 PM

All replies