title: Unix timestamp comparisons
body: <p>How do we compare various timestamp in a C program on Unix?</p>
  
  <p>I have to write a pgm which will check a <code>ctime</code> of a file and if it is <code>&lt;</code> the machine boot time, the file will be removed. I am using <code>getutxid</code> to get the <code>BOOT_TIME</code> and <code>stat()</code> for the file <code>ctime</code>. It seems the timestamps returned against these two are in different format. What is the common format and how to convert so that logical comparisons are possible? Such as:</p>
  
  <pre><code>if (ctime &lt; boottime)
  </code></pre>
  
  <p>and etc.</p>