title: How convert time to specific timezone on windows in C++?
body: <p>Have a Unix timestamp and I need equivalents of localtime_s, but where I can pass in the timezone. Alternately I'm looking for a way to change the timezone programatically for the app (not the whole system), so that localtime_s returns the correct values.</p>
  
  <p>Strangely enough, if I set TZ environment variable in a shell to GMT, and then launch my application, localtime_s returns values in GMT.</p>
  
  <p>I've tried:</p>
  
  <pre><code>::SetEnvironmentVariable("TZ", "GMT");
  tzset();
  </code></pre>
  
  <p>But it does not change the results of later calls to localtime_s</p>
  
  <p>Note that I'm running the application on Windows 7, using VS 2013.</p>