Edit

Share via


GetServerTimeZonesType Class

Definition

The GetServerTimeZonesType class represents a request to retrieve time zone definitions from the Exchange Server.

public ref class GetServerTimeZonesType : ExchangeWebServices::BaseRequestType
public class GetServerTimeZonesType : ExchangeWebServices.BaseRequestType
Public Class GetServerTimeZonesType
Inherits BaseRequestType
Inheritance
GetServerTimeZonesType

Examples

The following code example shows you how to retrieve complete time zone definitions for the Eastern Standard Time time zone and the Pacific Standard Time time zone.

static void GetTZDefinition(ExchangeServiceBinding esb)
{
    // Form the request.
    GetServerTimeZonesType gstzRequest = new GetServerTimeZonesType();

    // Identify the time zone definitions to retrieve.
    gstzRequest.Ids = new string[] { "Eastern Standard Time", "Pacific Standard Time" };

    // Specify that complete time zone definitions are requested.
    gstzRequest.ReturnFullTimeZoneData = true;
    gstzRequest.ReturnFullTimeZoneDataSpecified = true;

    try
    {
        // Send the request and get the response.
        GetServerTimeZonesResponseType gstzResponse = esb.GetServerTimeZones(gstzRequest);
        GetServerTimeZonesResponseMessageType responseMsg = gstzResponse.ResponseMessages.Items[0] as GetServerTimeZonesResponseMessageType;

        // Iterate through the time zone definitions.
        if (responseMsg.ResponseClass == ResponseClassType.Success)
        {
            foreach (TimeZoneDefinitionType tzd in responseMsg.TimeZoneDefinitions.TimeZoneDefinition)
            {
                Console.WriteLine("Time Zone name: " + tzd.Name);
                Console.WriteLine("Time Zone id:   " + tzd.Id);
                Console.WriteLine("");
            }
        }
        else
        {
            throw new Exception("GetServerTimeZones() failed.");
        }
    catch (Exception e)
    {
        Console.WriteLine(e.Message);
    }
}

Constructors

GetServerTimeZonesType()

The GetServerTimeZonesType constructor initializes a new instance of the GetServerTimeZonesType class.

Properties

Ids

The Ids property gets or sets an array of identifiers that represent the requested time zone definitions.

ReturnFullTimeZoneData

The ReturnFullTimeZoneData property gets or sets a Boolean value that indicates whether the GetServerTimeZones operation returns the complete definition or only the name and identifier for each time zone.

ReturnFullTimeZoneDataSpecified

The ReturnFullTimeZoneDataSpecified property gets a Boolean value that specifies whether the ReturnFullTimeZoneData property is serialized into the SOAP request.

Applies to