title: Confusing behaviour of mktime() function : increasing tm_hour count by one
body: <p>I am executing below code.  </p>
  
  <pre><code>int main()
  {
  struct tm storage={0,0,0,0,0,0,0,0,0};
  char *p = NULL; 
  p = (char *)strptime("2012-08-25 12:23:12","%Y-%m-%d %H:%M:%S",&amp;storage);
  char buff[1024]={0};
  strftime(buff,1024,"%Y-%m-%d %H:%M:%S",&amp;storage);
  cout &lt;&lt; buff &lt;&lt; endl;
  storage.tm_sec += 20;
  strftime(buff,1024,"%Y-%m-%d %H:%M:%S",&amp;storage);
  cout &lt;&lt; buff &lt;&lt; endl;
  mktime(&amp;storage);
  strftime(buff,1024,"%Y-%m-%d %H:%M:%S",&amp;storage);
  cout &lt;&lt; buff &lt;&lt; endl;
  return 0;
  }
  </code></pre>
  
  <p>If above Program executed, It prints ' 2012-08-25 13:23:32' instead of '2012-08-25 12:23:32'. Please Help, why it is increasing tm_hour value.
  This works correctly if I put input date as '2012-02-25 12:23:32' in program, which is confusing.</p>
  
  <p>OUtput -></p>
  
  <pre><code>[user@rtpkvm55-vm2 root]$ ./a.out
  2012-08-25 12:23:12
  2012-08-25 12:23:32
  2012-08-25 13:23:32
  [user@rtpkvm55-vm2 root]$
  </code></pre>
  
  <p>Date Info on my system, --></p>
  
  <pre><code>[user@rtpkvm55-vm2 root]$ date
  Sat Aug 25 08:28:26 EDT 2012
  </code></pre>