Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

TimeZoneInfo Class

Represents a time zone.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)
[TypeForwardedFromAttribute("System.Core, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=b77a5c561934e089")]
public sealed class TimeZoneInfo : IEquatable<TimeZoneInfo>

The TimeZoneInfo type exposes the following members.

  NameDescription
Public propertySupported by Silverlight for Windows PhoneSupported by Xbox 360BaseUtcOffsetGets the time difference between the current time zone's standard time and Coordinated Universal Time (UTC).
Public propertySupported by Silverlight for Windows PhoneSupported by Xbox 360DaylightNameGets the localized display name for the current time zone's daylight saving time.
Public propertySupported by Silverlight for Windows PhoneSupported by Xbox 360DisplayNameGets the localized general display name that represents the time zone.
Public propertyStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360LocalGets a TimeZoneInfo object that represents the local time zone.
Public propertySupported by Silverlight for Windows PhoneSupported by Xbox 360StandardNameGets the localized display name for the time zone's standard time.
Public propertySupported by Silverlight for Windows PhoneSupported by Xbox 360SupportsDaylightSavingTimeGets a value indicating whether the time zone has any daylight saving time rules.
Public propertyStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360UtcGets a TimeZoneInfo object that represents the Coordinated Universal Time (UTC) zone.
Top
  NameDescription
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360ConvertTime(DateTime, TimeZoneInfo)Converts a time to the time in a particular time zone.
Public methodStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360ConvertTime(DateTimeOffset, TimeZoneInfo)Converts a time to the time in a particular time zone.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360Equals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360Equals(TimeZoneInfo)Determines whether the current TimeZoneInfo object and another TimeZoneInfo object are equal.
Protected methodSupported by Silverlight for Windows PhoneSupported by Xbox 360FinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360GetAmbiguousTimeOffsets(DateTime)Returns information about the possible dates and times that an ambiguous date and time can be mapped to.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360GetAmbiguousTimeOffsets(DateTimeOffset)Returns information about the possible dates and times that an ambiguous date and time can be mapped to.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360GetHashCodeServes as a hash function for hashing algorithms and data structures such as hash tables. (Overrides Object.GetHashCode().)
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360GetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360GetUtcOffset(DateTime)Calculates the offset or difference between the time in this time zone and Coordinated Universal Time (UTC) for a particular date and time.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360GetUtcOffset(DateTimeOffset)Calculates the offset or difference between the time in this time zone and Coordinated Universal Time (UTC) for a particular date and time.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360IsAmbiguousTime(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.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360IsAmbiguousTime(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.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360IsDaylightSavingTime(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.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360IsDaylightSavingTime(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.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360IsInvalidTimeIndicates whether a particular date and time is invalid.
Protected methodSupported by Silverlight for Windows PhoneSupported by Xbox 360MemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360ToStringReturns the current TimeZoneInfo object's display name. (Overrides Object.ToString().)
Top

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 Silverlight 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.

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

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.