title: What's the most efficient way to strip out the time from a Java Date object?
body: <p>What's the most efficient way to remove the time portion from a Java date object using only Classes from within the JDK?</p>
  
  <p>I have the following</p>
  
  <blockquote>
    <p>myObject.getDate() =
    {java.util.Date}"Wed May 26 23:59:00
    BST 2010"</p>
  </blockquote>
  
  <p>To reset the time back to 00:00:00, I'm doing the following</p>
  
  <pre><code>SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
  Date myDate = sdf.parse(sdf.format(myObject.getDate()));
  </code></pre>
  
  <p>The output is now</p>
  
  <blockquote>
    <p>myDate = {java.util.Date}"Wed May 26
    00:00:00 BST 2010"</p>
  </blockquote>
  
  <p>Is there a better way to achieve the same result?</p>