Document IANA time zone support on Windows in FindSystemTimeZoneById#11896
Open
oii-nasif wants to merge 1 commit intodotnet:mainfrom
Open
Document IANA time zone support on Windows in FindSystemTimeZoneById#11896oii-nasif wants to merge 1 commit intodotnet:mainfrom
oii-nasif wants to merge 1 commit intodotnet:mainfrom
Conversation
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 dotnet#10713
tarekgh
reviewed
Nov 19, 2025
| 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 <xref:System.TimeZoneInfo> objects returned by the <xref:System.TimeZoneInfo.GetSystemTimeZones%2A> 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 <xref:System.TimeZoneInfo.CreateCustomTimeZone%2A> method or by calling <xref:System.TimeZoneInfo.FromSerializedString%2A> to deserialize a <xref:System.TimeZoneInfo> 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 <xref:System.TimeZoneInfo.FindSystemTimeZoneById%2A> method. These custom time zones can be accessed only through the object reference returned by the <xref:System.TimeZoneInfo.CreateCustomTimeZone%2A> or <xref:System.TimeZoneInfo.FromSerializedString%2A> 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 <xref:System.TimeZoneInfo.CreateCustomTimeZone%2A> method or by calling <xref:System.TimeZoneInfo.FromSerializedString%2A> to deserialize a <xref:System.TimeZoneInfo> 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 <xref:System.TimeZoneInfo.FindSystemTimeZoneById%2A> method. These custom time zones can be accessed only through the object reference returned by the <xref:System.TimeZoneInfo.CreateCustomTimeZone%2A> or <xref:System.TimeZoneInfo.FromSerializedString%2A> method call. |
Member
There was a problem hiding this comment.
It will be good to mention:
IANA IDs are supported on Windows only if neither NLS nor Globalization Invariant mode is enabled.
tarekgh
approved these changes
Nov 19, 2025
Member
tarekgh
left a comment
There was a problem hiding this comment.
Added a small suggestion, LGTM otherwise. Thanks @oii-nasif!
@BillWagner could you please have a quick look?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FindSystemTimeZoneByIdprovides cross-platform time zone resolutionDetails
The
FindSystemTimeZoneByIdmethod documentation previously only mentioned that Windows systems use registrylookups while Linux and macOS use the ICU Library. This could mislead developers into thinking IANA time zone
identifiers (like "Pacific/Auckland") only work on non-Windows platforms.
What Changed
Updated the Remarks section to clarify:
Why This Matters
This enhancement in .NET 6 allows developers to:
Without this documentation update, developers might unnecessarily write platform-specific code or miss out on this
cross-platform capability.
Fixes #10713