Quantcast
Channel: Exchange Server Development forum
Viewing all articles
Browse latest Browse all 7132

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

$
0
0

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


Viewing all articles
Browse latest Browse all 7132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>