title: Getting Windows Time Zone Information (C++/MFC)
body: <p>I’m trying to:</p>
  
  <ol>
  <li>Get a list of the time zone names as they appear in when the user selects a time zone from the Windows Control Panel (e.g., “(UTC-08:00) Pacific Time (US &amp; Canada)”).  </li>
  </ol>
  
  <p>I’m doing that by reading “CurrentVersion\Time Zones” section of the registry which works well.</p>
  
  <ol start="2">
  <li>Get the currently selected time zone as a string.</li>
  </ol>
  
  <p>I can get the current time zone using GetTimeZoneInformation(), but the names don’t match the list of time zones retrieved from “CurrentVersion\Time Zones” section of the registry. For example, Pacific time appears as “(UTC-08:00) Pacific Time (US &amp; Canada)” in the list of time zones, but GetTimeZoneInformation() contains the strings “Pacific Standard Time” and “Pacific Daylight Time”. I need to find a name that corresponds to the “CurrentVersion\Time Zones” names so I can select it from a list.</p>
  
  <ol start="3">
  <li>Get the current offset (in minutes) between UTC and any other time zone based on the string name.</li>
  </ol>
  
  <p>I can retrieve the offset from UTC in timeZoneInformation.Bias, but that’s only for the currently selected time zone. I need to know the “bias” from any zone as listed in the registry (e.g., “(UC-07:00) Mountain Time (US &amp; Canada)” while adjusting for the daylight savings if in effect.</p>