TimeZoneInfo
FindSystemTimeZoneById
.NET
C#
system time zones

What value should I pass into TimeZoneInfo.FindSystemTimeZoneByIdString?

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

Introduction

TimeZoneInfo.FindSystemTimeZoneById expects the exact time-zone ID known to the current operating system or runtime. The correct value is not a free-form label like "EST" or "New York"; it must match a real ID such as Eastern Standard Time or America/New_York.

The Method Expects The Id Property Value

The method signature is simple, but the input must be exact.

csharp
1using System;
2
3class Program
4{
5    static void Main()
6    {
7        var tz = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time");
8        Console.WriteLine(tz.DisplayName);
9    }
10}

The string you pass must correspond to a value returned by TimeZoneInfo.GetSystemTimeZones().

csharp
1using System;
2
3foreach (var tz in TimeZoneInfo.GetSystemTimeZones())
4{
5    Console.WriteLine(tz.Id);
6}

That is the safest way to discover what IDs are valid on the machine where your code is running.

Windows And Unix-Style Systems May Differ

Historically, Windows used Windows time-zone IDs such as:

  • 'Eastern Standard Time'
  • 'Pacific Standard Time'
  • 'Tokyo Standard Time'

Linux and macOS typically use IANA IDs such as:

  • 'America/New_York'
  • 'America/Los_Angeles'
  • 'Asia/Tokyo'

So the right value depends on platform unless your runtime version and globalization configuration provide cross-platform support for the ID format you want.

Do Not Use Abbreviations Like EST

Abbreviations are ambiguous and usually not accepted.

Bad examples:

  • 'EST'
  • 'PST'
  • 'Toronto'
  • 'GMT-5'

Those are not stable system IDs for FindSystemTimeZoneById.

Use the actual system-recognized ID instead.

A Cross-Platform Pattern

If your application runs on multiple operating systems, prefer storing a standard identifier format consistently and mapping when necessary.

On modern .NET, many teams standardize on IANA IDs in application data because they are widely used outside Windows.

A practical defensive pattern is:

csharp
1using System;
2using System.Runtime.InteropServices;
3
4string id = RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
5    ? "Eastern Standard Time"
6    : "America/New_York";
7
8TimeZoneInfo tz = TimeZoneInfo.FindSystemTimeZoneById(id);
9Console.WriteLine(tz.Id);

If you need broader compatibility across older runtimes or mixed environments, use a dedicated mapping layer instead of scattering literal IDs throughout the codebase.

Validate Early

If the ID comes from configuration or user data, validate it during startup rather than failing later in date-conversion code.

csharp
1try
2{
3    TimeZoneInfo.FindSystemTimeZoneById("America/New_York");
4}
5catch (TimeZoneNotFoundException)
6{
7    Console.WriteLine("Unknown time-zone ID");
8}

That makes configuration problems obvious and easier to diagnose.

Use The Retrieved Zone For Conversion, Not Just Lookup

Usually the lookup is only the first step. After retrieving the zone, convert values from UTC explicitly.

csharp
1using System;
2
3TimeZoneInfo tz = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time");
4DateTime utc = new DateTime(2025, 9, 1, 15, 0, 0, DateTimeKind.Utc);
5DateTime local = TimeZoneInfo.ConvertTimeFromUtc(utc, tz);
6
7Console.WriteLine(local);

This is a good reminder that the stored ID should represent a real zone with daylight-saving rules, not just a fixed offset label.

In real applications, store the zone ID itself in configuration or user preferences so later conversions stay deterministic.

Common Pitfalls

The biggest mistake is passing a display label or abbreviation instead of a real time-zone ID.

Another common problem is assuming the same ID format works on every platform without checking runtime support.

Developers also sometimes hard-code a Windows ID and then deploy to Linux, where that ID may not exist.

Finally, do not guess the valid values. Enumerate them with GetSystemTimeZones() or validate against a known mapping strategy.

Summary

  • Pass the exact value of a real time-zone Id.
  • Use TimeZoneInfo.GetSystemTimeZones() to discover valid IDs.
  • Prefer real IDs such as Eastern Standard Time or America/New_York, not abbreviations.
  • Be careful about Windows versus IANA ID differences across platforms.
  • Validate configured time-zone IDs early so failures are obvious.

Course illustration
Course illustration

All Rights Reserved.