共用方式為


SPRegionalSettings.GlobalTimeZones property

取得執行SharePoint Foundation的伺服器辨識的時區。

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'宣告
Public Shared ReadOnly Property GlobalTimeZones As SPTimeZoneCollection
    Get
'用途
Dim value As SPTimeZoneCollection

value = SPRegionalSettings.GlobalTimeZones
public static SPTimeZoneCollection GlobalTimeZones { get; }

Property value

Type: Microsoft.SharePoint.SPTimeZoneCollection
SPTimeZoneCollection 物件,代表辨識SharePoint Foundation伺服器的時區。時區的這份清單可與 Windows Server 時間區域不同。

Examples

下列程式碼範例會顯示SharePoint Foundation中所定義的所有時區。

Dim timeZonesList As SPTimeZoneCollection = SPRegionalSettings.GlobalTimeZones
Dim timeZone As SPTimeZone

For Each timeZone In  timeZonesList
    Console.WriteLine(("Time Zone: " + timeZone.Description))
Next timeZone
SPTimeZoneCollection collTimeZonesAvailable = SPRegionalSettings.GlobalTimeZones; 

foreach (SPTimeZone oTimeZoneAvailable in collTimeZonesAvailable) 
{
    Console.WriteLine("Time Zone: " + oTimeZoneAvailable.Description);
} 

請參閱

參照

SPRegionalSettings class

SPRegionalSettings members

Microsoft.SharePoint namespace