title: java - how to compare same days in date
body: <p>I have a long data member that represents a date.<br>
  I cast it to a     </p>
  
  <pre><code> Date d = new Date(long);  
  </code></pre>
  
  <p>I want to now if a nother date has the same day. 
  How do I do it? 
  Thanks.<br>
       (For andrew)</p>
  
  <p>Edit : </p>
  
  <p>Found this solution</p>
  
  <pre><code> SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMdd");
   return fmt.format(date1).equals(fmt.format(date2));
  </code></pre>
  
  <p>in here
  <a href="https://stackoverflow.com/questions/2517709/java-comparing-two-dates-to-see-if-they-are-in-the-same-day">Comparing two java.util.Dates to see if they are in the same day</a>
  looks nice</p>