Export (0) Print
Expand All

Web Services Time Zones

Exchange Server 2010

Scheduling appointments and tasks across time zones can be puzzling. The addition of daylight savings time can compound the puzzle, especially with a world-wide workforce that resides in many different time zones. To simplify setting times and dates Microsoft Exchange Server 2010 internally stores all dates and times in Universal Coordinated Time (UTC).

Client applications that send appointments to Exchange 2010 specify the local time zone in the XML request. Exchange 2010 converts the local time to UTC before storing the appointment in the data store. Client applications can request a list of local time zones that Exchange 2010 server will convert using the GetServerTimeZones Operation Web service operation. This operation will return a list of time zone definitions that contains the name of the time zone, and identifier for the time zone, and optionally full details of the time zone and any transitions that occur, such as a transition from standard time to daylight savings time. If you specify the time zone identifier for a specific time zone, the GetServerTimeZones Operation operation will only return information for the specified time zone.

The following example shows a request to retrieve the name and identifier for all time zones supported by an Exchange 2010 server.

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
               xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
  <soap:Header>
    <t:RequestServerVersion Version="Exchange2010_SP1"/>
  </soap:Header>

  <soap:Body>
    <m:GetServerTimeZones ReturnFullTimeZoneData="false">
    </m:GetServerTimeZones>
  </soap:Body>
</soap:Envelope>

The following is an abbreviated list of the time zones names and identifiers returned in response.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    <h:ServerVersionInfo MajorVersion="14" MinorVersion="1" MajorBuildNumber="218" MinorBuildNumber="12" Version="Exchange2010_SP1" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>
  </s:Header>
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <m:GetServerTimeZonesResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
      <m:ResponseMessages>
        <m:GetServerTimeZonesResponseMessage ResponseClass="Success">
          <m:ResponseCode>NoError</m:ResponseCode>
          <m:TimeZoneDefinitions>
            <t:TimeZoneDefinition Name="(UTC-12:00) International Date Line West" Id="Dateline Standard Time"/>
            <t:TimeZoneDefinition Name="(UTC-11:00) Coordinated Universal Time-11" Id="UTC-11"/>
            <t:TimeZoneDefinition Name="(UTC-11:00) Midway Island, Samoa" Id="Samoa Standard Time"/>
            <t:TimeZoneDefinition Name="(UTC-10:00) Hawaii" Id="Hawaiian Standard Time"/>
            <t:TimeZoneDefinition Name="(UTC-09:00) Alaska" Id="Alaskan Standard Time"/>
                                     .
                                     .
                                     .
            <t:TimeZoneDefinition Name="(UTC+12:00) Coordinated Universal Time+12" Id="UTC+12"/>
            <t:TimeZoneDefinition Name="(UTC+12:00) Fiji, Marshall Is." Id="Fiji Standard Time"/>
            <t:TimeZoneDefinition Name="(UTC+12:00) Petropavlovsk-Kamchatsky" Id="Kamchatka Standard Time"/>
            <t:TimeZoneDefinition Name="(UTC+13:00) Nuku'alofa" Id="Tonga Standard Time"/>
          </m:TimeZoneDefinitions>
        </m:GetServerTimeZonesResponseMessage>
      </m:ResponseMessages>
    </m:GetServerTimeZonesResponse>
  </s:Body>
</s:Envelope>

Specifying Appointment Start and End Time Zones

The <Start> and <End> elements in <CalendarItem> elements have corresponding <StartTimeZone> and <EndTimeZone> elements that specify the time zone identifier for the appointment's start and end time. If you do not specify the <StartTimeZone> and <EndTimeZone> elements the start and end times are assumed to be UTC. The following is a request to create an appointment with the time zone set to Pacific Time. The date of the appointment is during Daylight Savings Time in the time zone, so the time zone offset is UTC-7:00.

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
               xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
  <soap:Header>
    <t:RequestServerVersion Version="Exchange2010_SP1"/>
  </soap:Header>
  <soap:Body>
    <m:CreateItem SendMeetingInvitations="SendToAllAndSaveCopy">
      <m:SavedItemFolderId>
        <t:DistinguishedFolderId Id="calendar"/>
      </m:SavedItemFolderId>
      <m:Items>
        <t:CalendarItem>
          <t:Subject>EWS Meeting Request</t:Subject>
          <t:Start>
            2011-03-25T15:00:00
          </t:Start>
          <t:End>
            2011-03-25T16:00:00
          </t:End>
          <t:RequiredAttendees>
            <t:Attendee>
              <t:Mailbox>
                <t:EmailAddress>user1@contoso.com</t:EmailAddress>
              </t:Mailbox>
            </t:Attendee>
            <t:Attendee>
              <t:Mailbox>
                <t:EmailAddress>user2@contoso.com</t:EmailAddress>
              </t:Mailbox>
            </t:Attendee>
          </t:RequiredAttendees>
          <t:StartTimeZone Id="Pacific Standard Time" />
          <t:EndTimeZone Id="Pacific Standard Time" />
        </t:CalendarItem>
      </m:Items>
    </m:CreateItem>
  </soap:Body>
</soap:Envelope>

The following is an abbreviated response from the Exchange 2010 server showing the start and end times for the appointment adjusted to UTC.

    <m:GetItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
      <m:ResponseMessages>
        <m:GetItemResponseMessage ResponseClass="Success">
          <m:ResponseCode>NoError</m:ResponseCode>
          <m:Items>
            <t:CalendarItem>
              <t:ItemId Id="AAMkADliOTc…"/>
              <t:Subject>EWS Meeting Request</t:Subject>
                  .
                  .
                  .
              <t:Start>2011-03-25T22:00:00Z</t:Start>
              <t:End>2011-03-25T23:00:00Z</t:End>
                  .
                  .
                  .
            </t:CalendarItem>
          </m:Items>
        </m:GetItemResponseMessage>
      </m:ResponseMessages>
    </m:GetItemResponse>

Other elements, such as the <Task> element, use standard XML Schema date/time data type to specify dates and times. If you do not specify a time zone offset in a date/time element, the Exchange 2010 server will interpret the time as UTC.

The following is a request to create a task item with the time zone offset to UTC-7:00, Pacific Daylight Time.

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
               xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
  <soap:Header>
    <t:RequestServerVersion Version="Exchange2010_SP1"/>
  </soap:Header>
  <soap:Body>
    <m:CreateItem MessageDisposition="SaveOnly">
      <m:Items>
        <t:Task>
          <t:Subject>Dated task</t:Subject>
          <t:DueDate>2011-03-25T17:00:00-07:00</t:DueDate>
          <t:Status>NotStarted</t:Status>
        </t:Task>
      </m:Items>
    </m:CreateItem>
  </soap:Body>
</soap:Envelope>

The following is an abbreviated response from the Exchange 2010 server showing that the due date and time has been adjusted to UTC.

       <t:Task>
              <t:ItemId Id="AAMkADliOTc…"/>
              <t:ParentFolderId Id="AAMkADliOTc…/>
              <t:ItemClass>IPM.Task</t:ItemClass>
              <t:Subject>Dated task</t:Subject>
                     .
                     .
                     .
              <t:DueDate>2011-03-26T00:00:00Z</t:DueDate>
                     .
                     .
                     .
            </t:Task>
Show:
© 2014 Microsoft