applyPattern() in SimpleDateFormat gives NullPointerEcxeption with white space in java
<p>I have this code that formats the date to this pattern dd-MM-yyyy:</p>

<pre><code>     SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.S");
    sdf.applyPattern("yyyy-MM-dd");
     Date date_out = null;
    try {
        date_out = sdf.parse(date);
    } catch (ParseException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
 sdf.format(date_out);
</code></pre>

<p>However when I change separator from "-" to white space or slash "/" I get NullPointerEcxeption on the format() line. Does SimpleDateFormat accept white space or any other character as date separators? </p>
