title: Convert iso8601 string date time format to date in Java
body: <p>All,</p>
  
  <p>I know I have asked a similar question on parsing an ISO8601 date string into a Date using Java before, but this is a more specific problem using the SimpleDateFormat class.</p>
  
  <p>I have read the article <a href="http://en.wikipedia.org/wiki/ISO_8601" rel="nofollow">Wiki ISO8601 Date</a>.</p>
  
  <p>I have been supplied an XML file from a customer which has a date and time with the following format:</p>
  
  <p><strong>2012-08-24T12:15:00+02:00</strong></p>
  
  <p>According to the Wiki article this is valid which is fair enough.</p>
  
  <p>Given the following code to parse this string, a ParseException is thrown with the message "Unparseable date: "2012-08-24T12:15:00+02:00"".</p>
  
  <pre><code>String inputDate = "2012-08-24T12:15:00+02:00";
  String format = "yyyy-MM-dd'T'HH:mm:ssz";
  
  SimpleDateFormat sdf = new SimpleDateFormat(format);
  Date d = sdf.parse(inputDate);
  </code></pre>
  
  <p>The problem is with the colon in the timezone specifier.  +02:00 in the timezone causes the exception to be thrown.  +0200 works fine.</p>
  
  <p>Question is, is it possible to parse this type of string with the SimpleDateFormat?</p>
  
  <p>Thanks</p>
  
  <p>Andez</p>