Fork me on GitHub

Timezone: Retrieving Timezone Definitions

Last updated: Jun 12, 2012

There are two examples for retrieving timezone definitions below. The first will retrieve the definition for specific timezones while the second will retrieve the definition for all timezones supported by the server.

Note: The GetServerTimeZones operation was introduced in Exchange 2010 and therefore is unavailable on Exchange 2007 servers.

Specific timezone definitions

$ews = new ExchangeWebServices($host, $user, $pass, $version);

$request = new EWSType_GetServerTimeZonesType();
$request->Ids = new EWSType_NonEmptyArrayOfTimeZoneIdType();
$request->Ids->Id[] = 'Eastern Standard Time';
$request->Ids->Id[] = 'Pacific Standard Time';

$response = $ews->GetServerTimeZones($request);
var_dump($response);

All supported timezone definitions

$ews = new ExchangeWebServices($host, $user, $pass, $version);

$request = new EWSType_GetServerTimeZonesType();

$response = $ews->GetServerTimeZones($request);
var_dump($response);