获取识别正在运行SharePoint Foundation的服务器的时区。
命名空间: Microsoft.SharePoint
程序集: Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)
语法
声明
Public Shared ReadOnly Property GlobalTimeZones As SPTimeZoneCollection
Get
用法
Dim value As SPTimeZoneCollection
value = SPRegionalSettings.GlobalTimeZones
public static SPTimeZoneCollection GlobalTimeZones { get; }
属性值
类型:Microsoft.SharePoint.SPTimeZoneCollection
一个代表识别SharePoint Foundation服务器的时区的SPTimeZoneCollection对象。此列表是时区的不同于 Windows Server 的时区。
示例
下面的代码示例显示在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);
}