Sdílet prostřednictvím


TimeZoneInfo.Utc Property

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

Gets a TimeZoneInfo object that represents the Coordinated Universal Time (UTC) zone.

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

Syntax

'Declaration
Public Shared ReadOnly Property Utc As TimeZoneInfo
public static TimeZoneInfo Utc { get; }

Property Value

Type: System.TimeZoneInfo
A TimeZoneInfo object that represents the Coordinated Universal Time (UTC) zone.

Remarks

Coordinated Universal Time (UTC) was previously known as Greenwich Mean Time (GMT).

Important noteImportant Note:

You should access the Coordinated Universal Time zone through the TimeZoneInfo.Utc property rather than assigning the UTC time zone to a TimeZoneInfo object variable.

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 Coordinated Universal Time (UTC) and outputs its display name, standard time name, and daylight saving time name.

Dim universalZone As TimeZoneInfo = TimeZoneInfo.Utc
outputBlock.Text &= String.Format("The universal time zone is {0}.", universalZone.DisplayName) & vbCrLf
outputBlock.Text &= String.Format("Its standard name is {0}.", universalZone.StandardName) & vbCrLf
outputBlock.Text &= String.Format("Its daylight savings name is {0}.", universalZone.DaylightName) & vbCrLf
TimeZoneInfo universalZone = TimeZoneInfo.Utc;
outputBlock.Text += String.Format("The universal time zone is {0}.", universalZone.DisplayName) + "\n";
outputBlock.Text += String.Format("Its standard name is {0}.", universalZone.StandardName) + "\n";
outputBlock.Text += String.Format("Its daylight savings name is {0}.", universalZone.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.