title: Convert epoch time to human date time string without daylight saving conversion
body: <p>I am new to C and I'm currently working on a project where I need to convert an epoch time to a human date and time string. </p>
  
  <p>I have a UTC timestamp of <code>1411210794</code> which is for <code>20th September 2014 10:59:54</code>. </p>
  
  <p>I then run the following function on the UTC timestamp to convert to a human readable timestamp:</p>
  
  <pre><code>void UTCoTimeDate(char** date, char** time, long UTC, BOOL includeSeconds)
  {
       time_t epch = UTC;
       struct tm *timeptr =  gmtime(&amp;epch);
       asprintf(date, "%d-%.2d-%.2d", 1900 + timeptr-&gt;tm_year, timeptr-&gt;tm_mon+1, timeptr-&gt;tm_mday);
       if (includeSeconds)
       {
          asprintf(time, "%.2d:%.2d:%.2d", timeptr-&gt;tm_hour, timeptr-&gt;tm_min, timeptr-&gt;tm_sec);
       }
       else
       {
          asprintf(time, "%.2d:%.2d", timeptr-&gt;tm_hour, timeptr-&gt;tm_min); 
       }
  }
  </code></pre>
  
  <p>When I run this through gdb and look at the <code>tm *timeptr</code> contents the hour has become <code>11</code> instead of staying at 10. Below is the full content of the tm struct</p>
  
  <pre><code>{tm_sec = 54, tm_min = 59, tm_hour = 11, tm_mday = 20, tm_mon = 8, tm_year = 114, tm_wday = 6, tm_yday = 262, tm_isdst = 1, tm_gmtoff = 3600,
    tm_zone = 0x806c488 "BST"}
  </code></pre>
  
  <p>I was expecting the human date to come back as 10:59:54 not 11:59:54. </p>