title: c++ time stamp to human readable datetime function
body: <p>i have simple function that i need to return human readable date time from timestamp but somehow 
  it returns the same timestam in seconds:  </p>
  
  <p>input 1356953890</p>
  
  <pre><code>std::string UT::timeStampToHReadble(long  timestamp)
  {
      const time_t rawtime = (const time_t)timestamp;
  
      struct tm * dt;
      char timestr[30];
      char buffer [30];
  
      dt = localtime(&amp;rawtime);
      // use any strftime format spec here
      strftime(timestr, sizeof(timestr), "%m%d%H%M%y", dt);
      sprintf(buffer,"%s", timestr);
      std::string stdBuffer(buffer);
      return stdBuffer;
  }
  </code></pre>
  
  <p>output 1231133812</p>
  
  <p>this is how i call it : </p>
  
  <pre><code>long timestamp = 1356953890L ;
  std::string hreadble = UT::timeStampToHReadble(timestamp);
  std::cout &lt;&lt; hreadble &lt;&lt; std::endl;
  </code></pre>
  
  <p>and the output is : 1231133812
  and i what it to be somekind of this format : 31/1/ 2012 11:38:10 
  what im missing here ? </p>
  
  <p><strong>UTDATE :</strong><br>
  the solution 
  strftime(timestr, sizeof(timestr), " %H:%M:%S %d/%m/%Y", dt);</p>