TimeZoneInfo Class

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Represents a time zone.

Inheritance Hierarchy

System..::.Object
  System..::.TimeZoneInfo

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

Syntax

Public NotInheritable Class TimeZoneInfo _
    Implements IEquatable(Of TimeZoneInfo)
public sealed class TimeZoneInfo : IEquatable<TimeZoneInfo>

The TimeZoneInfo type exposes the following members.

Properties

  Name Description
BaseUtcOffset Gets the time difference between the current time zone's standard time and Coordinated Universal Time (UTC).
DaylightName Gets the localized display name for the current time zone's daylight saving time.
DisplayName Gets the localized general display name that represents the time zone.
Local Gets a TimeZoneInfo object that represents the local time zone.
StandardName Gets the localized display name for the time zone's standard time.
SupportsDaylightSavingTime Gets a value indicating whether the time zone has any daylight saving time rules.
Utc Gets a TimeZoneInfo object that represents the Coordinated Universal Time (UTC) zone.

Top

Methods

  Name Description
ConvertTime(DateTime, TimeZoneInfo) Converts a time to the time in a particular time zone.
ConvertTime(DateTimeOffset, TimeZoneInfo) Converts a time to the time in a particular time zone.
Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Equals(TimeZoneInfo) Determines whether the current TimeZoneInfo object and another TimeZoneInfo object are equal.
Finalize Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
GetAmbiguousTimeOffsets(DateTime) Returns information about the possible dates and times that an ambiguous date and time can be mapped to.
GetAmbiguousTimeOffsets(DateTimeOffset) Returns information about the possible dates and times that an ambiguous date and time can be mapped to.
GetHashCode Serves as a hash function for hashing algorithms and data structures such as hash tables. (Overrides Object..::.GetHashCode()()().)
GetType Gets the Type of the current instance. (Inherited from Object.)
GetUtcOffset(DateTime) Calculates the offset or difference between the time in this time zone and Coordinated Universal Time (UTC) for a particular date and time.
GetUtcOffset(DateTimeOffset) Calculates the offset or difference between the time in this time zone and Coordinated Universal Time (UTC) for a particular date and time.
IsAmbiguousTime(DateTime) Determines whether a particular date and time in a particular time zone is ambiguous and can be mapped to two or more Coordinated Universal Time (UTC) times.
IsAmbiguousTime(DateTimeOffset) Determines whether a particular date and time in a particular time zone is ambiguous and can be mapped to two or more Coordinated Universal Time (UTC) times.
IsDaylightSavingTime(DateTime) Indicates whether a specified date and time falls in the range of daylight saving time for the time zone of the current TimeZoneInfo object.
IsDaylightSavingTime(DateTimeOffset) Indicates whether a specified date and time falls in the range of daylight saving time for the time zone of the current TimeZoneInfo object.
IsInvalidTime Indicates whether a particular date and time is invalid.
MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
ToString Returns the current TimeZoneInfo object's display name. (Overrides Object..::.ToString()()().)

Top

Remarks

A time zone is a geographical region in which the same time is used. TimeZoneInfo is an immutable class that represents a time zone. It recognizes two predefined time zones:

  • The local time zone (the time zone of the system on which Windows Phone code is running). A TimeZoneInfo object that represents the local time zone can be retrieved from the TimeZoneInfo..::.Local property.

  • Coordinated Universal Time (UTC). A TimeZoneInfo object that represents UTC can be retrieved from the TimeZoneInfo..::.Utc property.

The TimeZoneInfo class includes the ConvertTime method, which allows conversions from the time in any time zone to either local time or UTC, or between the local time and UTC. It also offers a number of members that provide information about the time zone itself or about a particular time in that time zone.

You cannot instantiate a TimeZoneInfo object using the new keyword. Instead, you must retrieve the appropriate TimeZoneInfo object from either the Local property or the Utc property.

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Platforms

Windows Phone

Thread Safety

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

See Also

Reference

System Namespace