title: Java SimpleDateFormat cut trailing 0-digits of SSS
body: <p>hi i have an simple date format</p>
  
  <pre><code>new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
  </code></pre>
  
  <p>It formats the date like this</p>
  
  <pre><code>2014-04-23 13:15:59.390 
  </code></pre>
  
  <p>is it possible to remove the trailing 0, except when the digit it it is not 0?</p>
  
  <pre><code>2014-04-23 13:15:59.39
  </code></pre>
  
  <p>ok i've found my problem</p>
  
  <pre><code>new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); 
  </code></pre>
  
  <p>gives me what i want, the problem is that i'm comparing it with a date-string which comes from a database.</p>
  
  <p>The database reads it from a timesamp column, which contains the correct value, but i'm reading it with a</p>
  
  <pre><code>resultSet.getString(i)
  </code></pre>
  
  <p>and for some reason it cutts the last digit... So my question should be, why does resultSet.getString cut the last character when reading a date field?</p>