title: Generate list of Windows-like friendly time zone names on Linux .NET Core
body: <p>We have a .NET 4.7 MVC 5 web app, running under Windows, that allows users to select their time zone using the standard Windows display names like <code>(UTC+00:00) Dublin, Edinburgh, Lisbon, London</code>:</p>
  
  <p><a href="https://i.stack.imgur.com/dI9NC.png" rel="noreferrer"><img src="https://i.stack.imgur.com/dI9NC.png" alt="Windows time zone display names"></a></p>
  
  <p>We would like to provide the same list of time zone options through a new API built with .NET Core 2.0, which will run in a Linux docker container.  Is this possible?</p>
  
  <p>I have found <a href="https://stackoverflow.com/a/17348822/5536">Matt Johnson's</a> excellent <a href="https://github.com/mj1856/TimeZoneConverter" rel="noreferrer">TimeZoneConverter</a> package, which does a great job at converting between Windows's <code>GMT Standard Time</code> and IANA's <code>Europe/London</code>.  However, I can't seem to get the Windows display name from anywhere.</p>
  
  <p>Here's some example code to list some time zone information:</p>
  
  <pre><code>var timeZoneIds = TimeZoneConverter.TZConvert.KnownWindowsTimeZoneIds.ToList();
  
  foreach (var timeZoneId in timeZoneIds.Take(4))
  {
      if (TimeZoneConverter.TZConvert.TryGetTimeZoneInfo(timeZoneId, out var timeZoneInfo))
      {
          Console.WriteLine($"Windows Id:   {timeZoneId}");
          Console.WriteLine($".NET Id:      {timeZoneInfo.Id}");
          Console.WriteLine($"Display name: {timeZoneInfo.DisplayName}");
          Console.WriteLine("----");
      }
  }
  </code></pre>
  
  <p>When run on my Windows development machine, it gives this output:</p>
  
  <pre><code>Windows Id:   AUS Central Standard Time
  .NET Id:      AUS Central Standard Time
  Display name: (UTC+09:30) Darwin
  ----
  Windows Id:   AUS Eastern Standard Time
  .NET Id:      AUS Eastern Standard Time
  Display name: (UTC+10:00) Canberra, Melbourne, Sydney
  ----
  Windows Id:   Afghanistan Standard Time
  .NET Id:      Afghanistan Standard Time
  Display name: (UTC+04:30) Kabul
  ----
  Windows Id:   Alaskan Standard Time
  .NET Id:      Alaskan Standard Time
  Display name: (UTC-09:00) Alaska
  ----
  </code></pre>
  
  <p>When run inside a Linux docker container, we get this:</p>
  
  <pre><code>Windows Id:   AUS Central Standard Time
  .NET Id:      Australia/Darwin
  Display name: GMT+09:30
  ----
  Windows Id:   AUS Eastern Standard Time
  .NET Id:      Australia/Sydney
  Display name: GMT+10:00
  ----
  Windows Id:   Afghanistan Standard Time
  .NET Id:      Asia/Kabul
  Display name: GMT+04:30
  ----
  Windows Id:   Alaskan Standard Time
  .NET Id:      America/Anchorage
  Display name: GMT-09:00
  ----
  </code></pre>
  
  <p>Is there any way to get (say) <code>(UTC+10:00) Canberra, Melbourne, Sydney</code> when running inside the Linux docker container?</p>
  
  <p>Possible hacks or workarounds I've thought of so far:</p>
  
  <ul>
  <li>Hard-code the list of Windows display names in the API source</li>
  <li>Generate a "good enough" display name from the info that we do have, like <code>(GMT+10:00) AUS Eastern Standard Time</code></li>
  <li>See if Matt Johnson's <a href="https://github.com/mj1856/TimeZoneNames" rel="noreferrer">TimeZoneNames</a> package can used to generate a friendly list</li>
  </ul>