title: Comparing two java.util.Dates to see if they are in the same day
body: <p>I need to compare two <code>Date</code>s (e.g. <code>date1</code> and <code>date2</code>) and come up with a <code>boolean sameDay</code> which is true of the two <code>Date</code>s share the same day, and false if they are not.</p>
  
  <p>How can I do this? There seems to be a whirlwind of confusion here... and I would like to avoid pulling in other dependencies beyond the JDK if at all possible.</p>
  
  <p><strong>to clarify:</strong> if <code>date1</code> and <code>date2</code> share the same year, month, and day, then <code>sameDay</code> is true, otherwise it is false. I realize this requires knowledge of a timezone... it would be nice to pass in a timezone but I can live with either GMT or local time as long as I know what the behavior is.</p>
  
  <p><strong>again, to clarify:</strong></p>
  
  <pre><code>date1 = 2008 Jun 03 12:56:03
  date2 = 2008 Jun 03 12:59:44
    =&gt; sameDate = true
  
  date1 = 2009 Jun 03 12:56:03
  date2 = 2008 Jun 03 12:59:44
    =&gt; sameDate = false
  
  date1 = 2008 Aug 03 12:00:00
  date2 = 2008 Jun 03 12:00:00
    =&gt; sameDate = false
  </code></pre>