title: Java 8 DateTime Format Date + Offset
body: <p>I have to construct a <code>XMLGregorianCalendar</code> for a Webservice which expects a date in the format <code>yyyy-MM-dd+01:00</code>, where the value after <code>+</code> is derived from the time zone offsett.</p>
  
  <p>So far I have experimented with:</p>
  
  <pre><code>DateTimeFormatter formatterDateWithOffset = DateTimeFormatter.ofPattern("yyyy-MM-ddZZ");
  
  XMLGregorianCalendar xcal = DatatypeFactory.newInstance()
      .newXMLGregorianCalendar(zonedDateTime.format(formatterDateWithOffset));
  </code></pre>
  
  <p>But this results in an <code>IllegalArgumentExcpetion</code> because the formatter produces <code>2017-09-29+0200</code></p>
  
  <p>Is it possible to define a format string for the desired format?</p>