java : Unparseable date Exception
<p>I have this value,</p>

<blockquote>
  <p>2011-11-19T00:00:00.000-03:00</p>
</blockquote>

<p>which needs to be converted and set it in this format </p>

<blockquote>
  <p>yyyyMMdd</p>
</blockquote>

<p>I tried this way </p>

<pre><code>import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class ParsedDate {

    public static void main(String args[]) throws ParseException {
        DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ",
                Locale.US);
        String s1 = "2011-11-19T00:00:00.000-03:00";
        Date d = sdf.parse(s1);
        String s2 = (new SimpleDateFormat("yyyyMMdd")).format(d);
        System.out.println(s2);

    }
}
</code></pre>

<p>But it is giving me </p>

<p><strong>Exception in thread "main" java.text.ParseException: Unparseable date: "2011-11-19T00:00:00.000-03:00"</strong></p>

<p>Could anybody please help me? </p>
