title: Compare two times in C
body: <p>How do I compare time in C? 
  My program is getting the last modified time of 2 files, then compare that time to see which time is the latest.
  Is there a function that compares time for you, or you have to create one yourself? This is my get time function:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;time.h&gt;
  #include &lt;sys/stat.h&gt;
  #include &lt;sys/types.h&gt;
  
  void getFileCreationTime(char *path) {
      struct stat attr;
      stat(path, &amp;attr);
      printf("Last modified time: %s", ctime(&amp;attr.st_mtime));
  }
  </code></pre>