Sdílet prostřednictvím


TimeZoneInfo.DisplayName Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets the localized general display name that represents the time zone.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public ReadOnly Property DisplayName As String
public string DisplayName { get; }

Property Value

Type: System.String
The time zone's localized general display name.

Remarks

Version Notes

XNA Framework

 When this property is used in the XNA Framework, it throws a NotSupportedException exception.

Examples

The following example retrieves a TimeZoneInfo object that represents the local time zone and outputs its display name, standard time name, and daylight saving time name.

Dim localZone As TimeZoneInfo = TimeZoneInfo.Local
outputBlock.Text &= "Local Time Zone:" & vbCrLf
outputBlock.Text &= String.Format("   Display Name is: {0}.", localZone.DisplayName) & vbCrLf
outputBlock.Text &= String.Format("   Standard name is: {0}.", localZone.StandardName) & vbCrLf
outputBlock.Text &= String.Format("   Daylight saving name is: {0}.", localZone.DaylightName) & vbCrLf
TimeZoneInfo localZone = TimeZoneInfo.Local;
outputBlock.Text += "Local Time Zone ID:" + "\n";
outputBlock.Text += String.Format("   Display Name is: {0}.", localZone.DisplayName) + "\n";
outputBlock.Text += String.Format("   Standard name is: {0}.", localZone.StandardName) + "\n";
outputBlock.Text += String.Format("   Daylight saving name is: {0}.", localZone.DaylightName) + "\n";

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.