Skip to content

Conversation

oii-nasif
Copy link
Contributor

Summary

  • Added documentation noting that Windows systems support IANA time zone identifiers starting with .NET 6
  • Clarified that FindSystemTimeZoneById provides cross-platform time zone resolution
  • Included examples of IANA identifiers like "America/Los_Angeles" and "Pacific/Auckland"

Details

The FindSystemTimeZoneById method documentation previously only mentioned that Windows systems use registry
lookups 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:

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.

Why This Matters

This enhancement in .NET 6 allows developers to:

  • Use consistent time zone identifiers across all platforms
  • Write truly cross-platform code without platform-specific time zone handling
  • Leverage the more widely-used IANA time zone database on Windows

Without this documentation update, developers might unnecessarily write platform-specific code or miss out on this
cross-platform capability.

Fixes #10713

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
@oii-nasif oii-nasif requested a review from a team as a code owner October 4, 2025 00:10
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Oct 4, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Oct 4, 2025
@BillWagner BillWagner added area-System.DateTime and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.DateTime community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remarks could/should explain that FindSystemTimeZoneById now supports IANA time zones on Windows
2 participants