title: How to remove milliseconds from Date Object format in Java
body: <p>Since the <code>java.util.Date</code> object stores Date as <code>2014-01-24 17:33:47.214</code>, but I want the Date format as <code>2014-01-24 17:33:47</code>. <strong>I want to remove the milliseconds part.</strong></p>
  
  <p>I checked a question related to my question...</p>
  
  <p><a href="https://stackoverflow.com/q/3634771/2764279">How to remove sub seconds part of Date object</a></p>
  
  <p>I've tried the given answer</p>
  
  <pre><code>long time = date.getTime();
  date.setTime((time / 1000) * 1000);
  </code></pre>
  
  <p>but I've got my result Date format as <code>2014-01-24 17:33:47.0</code>. How can I remove that <code>0</code> from my Date format???</p>