title: Java change double to Date
body: <p>There is a problem when I tried to transform double to Date.
  This is my code:</p>
  
  <pre><code>double itemDouble = 1370437809.00;
  long itemLong = (long) (itemDouble * 1000);
  Date itemDate = new Date(itemLong);
  String itemDateStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SS").format(itemDate);
  </code></pre>
  
  <p>When the <code>itemDouble</code> is <code>1370437809.00</code>, <code>itemDateStr</code> is <code>2013-06-05 21:10:09.00,</code>
  but when the itemDouble's decimal places is not zero, such as <code>1370437809.66</code>, the <code>itemDateStr</code> is <code>2013-06-05 21:10:09.660</code>. The formatted date string is not right.</p>
  
  <p>How this happened?</p>