title: Are Windows timezone written in registry reliable?
body: <p>I'm creating a c++ project that should works on several timezone. The application receives an event, with a reference timezone, and this event is shown graphically to the user at the correct hour, in his local timezone. For example, an user working in Berlin receives an event written in Tokyo. The event from Tokyo is first converted in UTC time, then reconverted from UTC to the computer local time in Berlin, and finally shown to the user on his graphical interface.</p>
  <p>To convert from UTC to local computer time I have several functions of the Windows API at my disposal to do the job. But in order to convert a time from another timezone to UTC, I need to get the timezone information from the Windows registry.</p>
  <p>Now some timezone have also a Daylight Saving Time to consider. I'm able to create a recurrence rule from the Windows info without problems. However I noticed that the day the DST should occur is sometimes incorrect on several timezone. For example, the &quot;E. South America Standard Time&quot;. With the recurrence provided by Windows, the DST start day begins 1 week sooner.</p>
  <p>If I understood right, the recurrence rule returned by Windows for this specific timezone says &quot;every year, on the 2nd month, on the 2nd week of the month&quot;. However this rule matches rarely with the correct date published on the internet for the time changing, whereas the dates are all correct if the rule would be &quot;every year, on the 2nd month, on the 3nd week of the month&quot;. Furthermore, as you can see on the provided screenshot, the Windows registry data shows 2 weeks for the DST start time (highlighted in blue), but 3 weeks for the DST end time (surrounded in red), which is calculated correctly by my code. The description of the data content may be found here: <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms725481(v=vs.85).aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/windows/desktop/ms725481(v=vs.85).aspx</a></p>
  <p><a href="https://i.stack.imgur.com/wmb0h.png" rel="noreferrer"><img src="https://i.stack.imgur.com/wmb0h.png" alt="enter image description here" /></a></p>
  <p>I have several questions</p>
  <ul>
  <li>Have I understood the recurrence rule correctly? (Here is what MSDN says about it: <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms725481(v=vs.85).aspx" rel="noreferrer">https://msdn.microsoft.com/en-us/library/windows/desktop/ms725481(v=vs.85).aspx</a>)</li>
  <li>Is there known issues about several timezone, especially the &quot;E. South America Standard Time&quot; one?</li>
  <li>Is there a reason why a DST start date, that obviously occurs regularly every year, on the 3rd week of the 10th month, have a value set on the 2nd week?</li>
  <li>Are timezone written in Windows registry reliable, if not, which function of the Windows API should I use to convert a timezone with DST from a date written in a different timezone than the one set on the local machine?</li>
  </ul>
  <p><strong>NOTE</strong> I have strongly verified if the data I read from the registry were correct before posting this message. I'm pretty sure that is not an error of this type.</p>
  <p><strong>NOTE</strong> I'm working with Windows 7, but the issue remains the same on Windows 10</p>