code: public static Date fromISO8601(String pDateString) {
          if (datatypeFactory != null) {
              return datatypeFactory.newXMLGregorianCalendar(pDateString.trim()).toGregorianCalendar().getTime();
          } else {
              try {
                  // Try on our own, works for most cases
                  String date = pDateString.replaceFirst("([+-])(0\\d)\\:(\\d{2})$", "$1$2$3");
                  date = date.replaceFirst("Z$","+0000");
                  SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
                  return dateFormat.parse(date);
              } catch (ParseException e) {
                  throw new IllegalArgumentException("Cannot parse date '" + pDateString + "': " +e,e);
              }
          }
      }
docs: Parse an ISO-8601 string into an date object
  
  @param pDateString date string to parse
  @return the parse date
  @throws IllegalArgumentException if the provided string does not conform to ISO-8601