C++ std::localtime daylight saving time rule (dst) european vs american
<p>I've problem with use of the std::localtime function. When I transform a std::time_t to a local struct tm, it always use the american daylight saving time whereas I want to use the european one (France).</p>

<p>UTC : 03/19/16 16:56 is transformed in Local : 03/19/16 18:56.</p>

<p>At this date, normally, local is 17:56 (UTC+1). The DST happens on the 27th in France.
After several tests, it seems that the used DST is based on the american rule : DST happens on second sunday in march.</p>

<p>I've also changed the TZ environement variable, but it also fails.</p>

<hr>

<p>`</p>

<pre><code>if( putenv( "TZ=CET-1CEST-2,M3.5.0/2,M10.5.0/3" ) != 0 ) { 
     std::cout &lt;&lt; "Unable to set TZ" &lt;&lt; std::endl; 
} else { 
   tz = getenv("TZ"); 
   if (tz) std::cout &lt;&lt; tz &lt;&lt; std::endl; 
   else std::cout &lt;&lt; "TZ not defined" &lt;&lt; std::endl; tzset(); 
}

struct std::tm t;
t.tm_sec = 0;
t.tm_min = 56;
t.tm_hour = 18;
t.tm_mday = 19;
t.tm_mon = 3-1;
t.tm_year = 2016-1900;
t.tm_isdst = -1;
std::time_t tt = std::mktime(&amp;t);
std::cout &lt;&lt; "UTC: " &lt;&lt; std::put_time(std::gmtime(&amp;tt), "%c %Z") &lt;&lt; '\n'; // UTC : 03/19/16 16:56
std::cout &lt;&lt; "local: " &lt;&lt; std::put_time(std::localtime(&amp;tt), "%c %Z") &lt;&lt; '\n'; // Local : 03/19/16 18:56 (not waited result)
</code></pre>

<p>`</p>

<p>As a precision, I use the bcc32c compiler (the embarcadero C++ clang based computer). </p>

<p>I hope I'm clear enough and you'll be able to help me.</p>

<p>Thanks in advance</p>