title: compare two Groovy dates
body: <p>I take two dates from the user.</p>
  
  <pre><code>&lt;g:datePicker name="now"/&gt;  &lt;g:datePicker name="early"/&gt;
  </code></pre>
  
  <p>Then, in my controller:</p>
  
  <pre><code>if((params.early).compareTo(params.now)==0) {
    early=new Date(1970,1,1)
  }
  else {
    //do something
  }
  </code></pre>
  
  <p>the else part is getting executed even if the date is same.
  how do we compare date in groovy?</p>