title: Why does mktime() need to know about daylight saving time?
body: <p>So <code>mktime()</code> returns a <code>time_t</code> value which is defined as "an integral value representing the number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC" (<a href="http://www.cplusplus.com/reference/ctime/time_t/" rel="nofollow noreferrer">source</a>). I can convert a date to a <code>time_t</code> value by using <code>mktime()</code>. For example, to convert the date 10-Sep-2017 08:34:56 to a <code>time_t</code> I'd do the following:</p>
  
  <pre><code>struct tm tm;
  time_t tv;
  
  tm.tm_sec = 56;
  tm.tm_min = 34;
  tm.tm_hour = 8;
  tm.tm_mday = 10;
  tm.tm_mon = 8;
  tm.tm_year = 117;
  tm.tm_isdst = ????;
  
  tv = mktime(&amp;tm);
  </code></pre>
  
  <p>Now what I don't understand is the idea behind the <code>tm_isdst</code> parameter: It is described as "a flag that indicates whether daylight saving time is in effect <strong>at the time described</strong>" (<a href="https://linux.die.net/man/3/mktime" rel="nofollow noreferrer">source</a>).</p>
  
  <p>This description is somewhat confusing me because I'm of the opinion that the time I'm describing in <code>struct tm</code> is in fact already a UTC time and the <code>time_t</code> value I want to have from <code>mktime()</code> is UTC as well. But UTC time doesn't change with a change of seasons, so why does <code>mktime()</code> need to bother with daylight saving time at all? Isn't the advantage of using UTC instead of local time that I won't have to bother with daylight saving time? So why do I have to set <code>tm_isdst</code> then?</p>
  
  <p>I'm sure the answer is really simple but at the moment I'm failing to see it. Could somebody please provide a simple example that illustrates why <code>mktime()</code> needs the <code>tm_isdst</code> parameter to convert a certain date and time to a <code>time_t</code> value?</p>