Represents any time zone in the world.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
The TimeZoneInfo type exposes the following members.
| Name | Description | |
|---|---|---|
![]() ![]() ![]() | BaseUtcOffset | Gets the time difference between the current time zone's standard time and Coordinated Universal Time (UTC). |
![]() ![]() ![]() | DaylightName | Gets the display name for the current time zone's daylight saving time. |
![]() ![]() ![]() | DisplayName | Gets the general display name that represents the time zone. |
![]() | Id | Gets the time zone identifier. |
![]() ![]() ![]() ![]() | Local | Gets a TimeZoneInfo object that represents the local time zone. |
![]() ![]() ![]() | StandardName | Gets the 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. |
| Name | Description | |
|---|---|---|
![]() ![]() | ClearCachedData | Clears cached time zone data. |
![]() ![]() ![]() ![]() | 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. |
![]() ![]() | ConvertTime(DateTime, TimeZoneInfo, TimeZoneInfo) | Converts a time from one time zone to another. |
![]() ![]() | ConvertTimeBySystemTimeZoneId(DateTime, String) | Converts a time to the time in another time zone based on the time zone's identifier. |
![]() ![]() | ConvertTimeBySystemTimeZoneId(DateTimeOffset, String) | Converts a time to the time in another time zone based on the time zone's identifier. |
![]() ![]() | ConvertTimeBySystemTimeZoneId(DateTime, String, String) | Converts a time from one time zone to another based on time zone identifiers. |
![]() ![]() | ConvertTimeFromUtc | Converts a Coordinated Universal Time (UTC) to the time in a specified time zone. |
![]() ![]() | ConvertTimeToUtc(DateTime) | Converts the current date and time to Coordinated Universal Time (UTC). |
![]() ![]() | ConvertTimeToUtc(DateTime, TimeZoneInfo) | Converts the time in a specified time zone to Coordinated Universal Time (UTC). |
![]() ![]() | CreateCustomTimeZone(String, TimeSpan, String, String) | Creates a custom time zone with a specified identifier, an offset from Coordinated Universal Time (UTC), a display name, and a standard time display name. |
![]() ![]() | CreateCustomTimeZone(String, TimeSpan, String, String, String, TimeZoneInfo.AdjustmentRule[]) | Creates a custom time zone with a specified identifier, an offset from Coordinated Universal Time (UTC), a display name, a standard time name, a daylight saving time name, and daylight saving time rules. |
![]() ![]() | CreateCustomTimeZone(String, TimeSpan, String, String, String, TimeZoneInfo.AdjustmentRule[], Boolean) | Creates a custom time zone with a specified identifier, an offset from Coordinated Universal Time (UTC), a display name, a standard time name, a daylight saving time name, daylight saving time rules, and a value that indicates whether the returned object reflects daylight saving time information. |
![]() ![]() ![]() | Equals(Object) | Determines whether the current TimeZoneInfo object and another object are equal. (Overrides Object.Equals(Object).) In .NET Framework Client Profile 4, this member is inherited from Object.Equals(Object). In Portable Class Library Portable Class Library, this member is inherited from Object.Equals(Object). In .NET for Windows Store apps Windows 8, this member is inherited from Object.Equals(Object). |
![]() ![]() ![]() | Equals(TimeZoneInfo) | Determines whether the current TimeZoneInfo object and another TimeZoneInfo object are equal. |
![]() ![]() | FindSystemTimeZoneById | Retrieves a TimeZoneInfo object from the registry based on its identifier. |
![]() ![]() | FromSerializedString | Deserializes a string to re-create an original serialized TimeZoneInfo object. |
![]() | GetAdjustmentRules | Retrieves an array of TimeZoneInfo.AdjustmentRule objects that apply to the current TimeZoneInfo 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().) |
![]() ![]() | GetSystemTimeZones | Returns a sorted collection of all the time zones about which information is available on the local system. |
![]() ![]() ![]() | 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. |
![]() | HasSameRules | Indicates whether the current object and another TimeZoneInfo object have the same adjustment rules. |
![]() ![]() ![]() | 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. |
![]() | ToSerializedString | Converts the current TimeZoneInfo object to a serialized string. |
![]() ![]() ![]() | ToString | Returns the current TimeZoneInfo object's display name. (Overrides Object.ToString().) |
| Name | Description | |
|---|---|---|
![]() ![]() | IDeserializationCallback.OnDeserialization | Infrastructure. Runs when the deserialization of an object has been completed. |
![]() ![]() | ISerializable.GetObjectData | Infrastructure. Populates a SerializationInfo object with the data needed to serialize the current TimeZoneInfo object. |
A time zone is a geographical region in which the same time is used.
The TimeZoneInfo class offers significant enhancements over the TimeZone class, which provides only limited functionality.
The TimeZone class recognizes only the local time zone, and can convert times between Coordinated Universal Time (UTC) and local time. A TimeZoneInfo object can represent any time zone, and methods of the TimeZoneInfo class can be used to convert the time in one time zone to the corresponding time in any other time zone. The members of the TimeZoneInfo class support the following operations:
Retrieving a time zone that is already defined by the operating system.
Enumerating the time zones that are available on a system.
Converting times between different time zones.
Creating a new time zone that is not already defined by the operating system.
Serializing a time zone for later retrieval.
Note |
|---|
An instance of the TimeZoneInfo class is immutable. Once an object has been instantiated, its values cannot be modified. |
You cannot instantiate a TimeZoneInfo object using the new keyword. Instead, you must call one of the static members of the TimeZoneInfo class shown in the following table.
Static member name | Description |
|---|---|
CreateCustomTimeZone method | Creates a custom time zone from application-supplied data. |
FindSystemTimeZoneById method | Instantiates a time zone defined in the system registry based on the zone's identifier. |
FromSerializedString method | Deserializes a string value to re-create a previously serialized TimeZoneInfo object. |
GetSystemTimeZones method | Returns an enumerable ReadOnlyCollection<T> of TimeZoneInfo objects that represents all time zones that are available on the local system. |
Local property | Instantiates a TimeZoneInfo object that represents the local time zone. |
Utc property | Instantiates a TimeZoneInfo object that represents the UTC zone. |
You can use the CreateCustomTimeZone method to create a time zone that is not defined in the local system registry. You can then use the ToSerializedString property to save the time zone object's information as a string, which can be stored in some form that is accessible to the application. You can use the FromSerializedString method to convert a serialized string back to a TimeZoneInfo object.
Note |
|---|
The HostProtectionAttribute attribute applied to this type or member has the following Resources property value: MayLeakOnAbort. The HostProtectionAttribute does not affect desktop applications (which are typically started by double-clicking an icon, typing a command, or entering a URL in a browser). For more information, see the HostProtectionAttribute class or SQL Server Programming and Host Protection Attributes. |
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.


