Delen via


EWS: Exchange 2007 RTM vs. SP1 Specifying MeetingTimeZone's TimeZoneName when creating an Appointment

Prior to Exchange 2007 SP1 an article was published with some specific guidance related to handling time zones in calendar item tasks.  Contrary to Best Practices for Using Exchange Web Services for Calendaring Tasks, specifying just a MeetingTimeZone TimeZoneName when creating a CalendarItem appears to work in Exchange 2007 SP1 and later.  The best practices says not to submit the TimeZoneName in MeetingTimeZone because it will be ignored, though there is a hint that this might not apply to Exchange 2007 SP1:

“Do not supply the optional TimeZoneName element when you create calendar items. In the initial release version of Exchange 2007, the TimeZoneName element is ignored on incoming requests.”

However, take the following request which properly creates a CalendarItem in the Eastern time zone:

        <t:CalendarItem>

          <t:ItemClass>IPM.Appointment</t:ItemClass>

          <t:Subject>Appointment in Eastern Time</t:Subject>

          <t:Start>2009-06-26T09:00:00.000</t:Start>

          <t:End>2009-06-26T09:30:00.000</t:End>

          <t:MeetingTimeZone TimeZoneName="Eastern Standard Time">

          </t:MeetingTimeZone>

        </t:CalendarItem>

 

From the best practices, the following statement intends to confirm that TimeZoneName is not ignored in Exchange 2007 SP1 and can be used by itself to define a time zone:

“In Exchange Server 2007 Service Pack 1 (SP1), BaseOffset is an optional element, and supports MeetingTimeZones that specify the TimeZoneName only.”

This is quite true in fact, were in Exchange 2007 pre-SP1 specifying the offset elements was a requirement and TimeZoneName was ignored; in Exchange 2007 post-SP1 the TimeZoneName is actually the preferred method for declaring a time zone.  Furthermore, offset and transition values should only be set when specifying a custom time zone.  Otherwise, standard time zones should be specified using TimeZoneName which is the name of the time zone as it appears in the registry key name on the Exchange CAS server.  Then the Exchange server will pull the transition and offset information from the registry for the time zone you specified.  Here is an image showing where the registry keys are:

image

Bottom line, with Exchange 2007 SP1 don’t specify time zone offset and transition values for known time zones – use the TimeZoneName instead.  This will help your application work seamlessly with any updates to known time zone definitions in the future.