converting date timezone format in java
<p>Wrote below code for trying to convert date time from the value in double quotes but fails with parse exception. please advise</p>

<pre><code>public static void main(String args[]) {
    try {

        DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S Z");
        Date date = format.parse("2016-02-03 10:39:29.099545 -8:00");
    } catch (ParseException pe) {
        // TODO: Add catch code
        pe.printStackTrace();
    }
}
</code></pre>

<p>this fails with parse exception.</p>

<blockquote>
  <p>further more my final output should look like below format:
  2016-01-26T12:07:41-08:00</p>
</blockquote>