title: C++ convert string to time_t
body: <p>I'm using <code>stat.st_mtime</code> to get my last modification time of a directory and then store it into a <code>file.txt</code> (stored string is something like that : <code>1467035651</code>)</p>
  
  <p>Later when I retrieved data from  my <code>file.txt</code>, I tried to convert my string from my <em>file.txt</em> to <code>int</code> type  since the string contains just seconds but I don't know if it's a good idea to do that. </p>
  
  <p>Is there any way to convert directly to <code>time_t</code>?</p>