SPTimeZone Class

The SPTimeZone class represents the time zone setting that is implemented on a SharePoint Web site.

System.Object

   Microsoft.SharePoint.SPTimeZone

Public Methods

The following table shows the public methods of the SPTimeZone class and a brief description of each.

Name Description
LocalTimeToUTC Converts the specified DateTime value from local time to Coordinated Universal Time (UTC).
UTCToLocalTime Converts the specified DateTime value from Coordinated Universal Time (UTC) to local time.

Public Properties

The following table shows the public properties of the SPTimeZone class, the data type of each property, and a brief description of each.

Name Data Type Description
Description String Gets the description for the time zone.
ID UInt16 Gets or sets the ID for the time zone.
Information Microsoft.SharePoint.SPTimeZoneInformation Gets information about the time zone.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread safe.

Remarks

Use the TimeZone property of the SPRegionalSettings class to return the time zone used in a specific site. Otherwise, use the TimeZones property of either the SPRegionalSettings or SPGlobalAdmin class to return the collection of time zones used in the site or in the deployment of Microsoft Windows SharePoint Services. Use an indexer to return a single time zone from the collection. For example, if the collection is assigned to a variable named myTimeZones, use myTimeZones[index] in C#, or myTimeZones(index) in Visual Basic .NET, where index is the index number of the time zone in the collection.

Requirements

Namespace: Microsoft.SharePoint

Platforms: Microsoft Windows Server 2003

Assembly: Windows SharePoint Services (in Microsoft.SharePoint.dll)

Security: Code Access Security