title: How to compare two time stamp in format "Month Date hh:mm:ss" to check +ve or -ve value
body: <p>I checked the stackoverflow site for my answer, i did not get, so i am posting it here.</p>
  
  <p>My problem is:</p>
  
  <blockquote>
    <p>How to compare two time stamp in format <code>"Month Date hh:mm:ss"</code>?  </p>
  </blockquote>
  
  <p>I am writing program in C and C++ and the time is in displayable string format.</p>
  
  <p>Example :</p>
  
  <pre><code>time1 = "Mar 21 11:51:20"
  time2 = "Mar 21 10:20:05"
  </code></pre>
  
  <p>I want to compare time1 and tme2 and find out whether <code>time2</code> is <em>after</em> <code>time1</code> or not and I need output as <code>true</code> or <code>false</code>, like below:       </p>
  
  <pre><code> if time2 &gt; time1 then 
         i need output as 1 
   or 
         0 or -1 anything
  </code></pre>
  
  <p>I used <code>difftime(time2,time1)</code> , but it returns the delta time <code>diff</code> between <code>time1</code> and <code>time2</code>.<br>
  I want to check greater or not.  </p>
  
  <p>For any help, thanks in advance</p>