From 7513bba0fc4641c1a8541a2115ead0bcb22e8469 Mon Sep 17 00:00:00 2001 From: Nasif Ishtiaque Islam Date: Sat, 4 Oct 2025 06:09:17 +0600 Subject: [PATCH] Document IANA time zone support on Windows in FindSystemTimeZoneById Added clarification that starting with .NET 6, Windows systems support IANA time zone identifiers (like "America/Los_Angeles" or "Pacific/Auckland") in addition to Windows registry time zones. This provides cross-platform time zone resolution capabilities. The previous documentation only mentioned Windows registry lookups for Windows systems, which could mislead developers into thinking IANA identifiers only work on Linux and macOS. Fixes #10713 --- xml/System/TimeZoneInfo.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml/System/TimeZoneInfo.xml b/xml/System/TimeZoneInfo.xml index 8bb5a842225..bc4932eceeb 100644 --- a/xml/System/TimeZoneInfo.xml +++ b/xml/System/TimeZoneInfo.xml @@ -1872,7 +1872,7 @@ The `id` parameter must correspond exactly to the time zone's identifier in length, but not in case, for a successful match to occur; that is, the comparison of `id` with time zone identifiers is case-insensitive. If you want to retrieve time zone objects based on partial matches, you can write custom procedures that work with the read-only collection of objects returned by the method. -On Windows systems, `FindSystemTimeZoneById` tries to match `id` to the subkey names of the HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Time Zones branch of the registry. On Linux and macOS, it uses time zone information available in the [ICU Library](https://unicode-org.github.io/icu/userguide/datetime/timezone/). If the registry or the library does not have the information for the time zone you desire, you can create a particular time zone either by calling one of the overloads of the method or by calling to deserialize a object that represents the required time zone. However, time zones created by these method calls are not system-defined time and cannot be retrieved using the method. These custom time zones can be accessed only through the object reference returned by the or method call. +On Windows systems, `FindSystemTimeZoneById` tries to match `id` to the subkey names of the HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Time Zones branch of the registry. Starting with .NET 6, Windows systems also support IANA time zone identifiers (such as "America/Los_Angeles" or "Pacific/Auckland"), providing cross-platform time zone resolution. On Linux and macOS, it uses time zone information available in the [ICU Library](https://unicode-org.github.io/icu/userguide/datetime/timezone/). If the registry or the library does not have the information for the time zone you desire, you can create a particular time zone either by calling one of the overloads of the method or by calling to deserialize a object that represents the required time zone. However, time zones created by these method calls are not system-defined time and cannot be retrieved using the method. These custom time zones can be accessed only through the object reference returned by the or method call. In .NET 7 and earlier versions, this method returns a new instance for each method call. This might impact performance in applications that call the `FindSystemTimeZoneById` method repeatedly with the same identifier. (In .NET 8 and later versions, this method always returns a cached instance.)