title: how to use mktime to respect timezone
body: <p>How do I create timezone aware <code>struct tm</code> in Linux/gcc ?
  I have the following code:</p>
  
  <pre><code>struct tm date;
  date.tm_year=2012-1900;
  date.tm_mon=9;
  date.tm_mday=30;
  date.tm_hour=17;
  date.tm_min=45;
  date.tm_sec=0;
  date.tm_zone="America/New_York";
  time_t t = mktime(&amp;date);
  </code></pre>
  
  <p>When I print <code>t</code> the value is <code>1349045100</code>. So I take this uses both c++ and python to print as string,  it returns me:  <code>Sun Sep 30 18:45:00 2012</code>  which is one hour off. I want 17:45 not 18:45. The python command I am using is:</p>
  
  <pre><code> time.ctime(1349045100)
  </code></pre>
  
  <p>C++ I am using is:</p>
  
  <pre><code>::setenv("TZ", "America/New_York",1);
  ::tzset();
  strftime(tm_str, len_tm_str, "%Y%m%d %H:%M:%S", ::localtime(&amp;t));
  </code></pre>
  
  <p>So it seems when I construct the time it is already one hour off. How do I correct this?</p>