Date format parsing string java
<p>I got function:</p>

<pre><code>    public boolean isValidDate(String inDate) {
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:sssZ");
        dateFormat.setLenient(false);
    try {
      dateFormat.parse(inDate.trim());
    } catch (ParseException pe) {
      return false;
    }
    return true;
  }
</code></pre>

<p>And I need to verify if string: '<code>2015-01-06T10:51:26.227+0100</code>' is date, but funtion always return false. Could anybody tell me if my dateDormat: <code>"yyyy-MM-dd'T'HH:mm:sssZ"</code> is correct?
I read a lot of questions about formatting date, but I think my dateFormat is still not correct.</p>