Deci and Centi Seconds parsing in java
<p>I have time stamp as string "2013-01-28 11:01:56.9". Here 56.9 seconds are mentioned. </p>

<p>.9 seconds = 900 milliseconds</p>

<p>we can say it's 9 deci-seconds or 90 centi-seconds</p>

<p>But in java...</p>

<pre><code>String string = "2013-01-28 11:01:56.9";
String pattern = "yyyy-MM-dd hh:mm:ss.S";
SimpleDateFormat formatter = new SimpleDateFormat(pattern);
Date date = formatter.parse(string);
System.out.println(date.getTime());
</code></pre>

<p>Output is : 1359388916009</p>

<p>Here 9 is parsed as 009 milliseconds because "S" (Capital-S) is used for milliseconds.</p>

<p>Similarly if .95 seconds are provided as and parsed with "SS" pattern, it gives "095" milliseconds instead of "950" milliseconds.</p>

<ul>
<li>Why java does not provide pattern to parse/format deci-seconds and centi-seconds to make things easier?</li>
<li>What is the decent way to do so?</li>
</ul>
