title: xsd:dateTime to Java OffsetDateTime
body: <p>In order to properly handle an <a href="https://www.w3.org/TR/xmlschema-2/#dateTime" rel="noreferrer">xs:dateTime</a> with JAXB, I have to write my own converter from <code>String</code>-><a href="https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html" rel="noreferrer"><code>java.time.OffsetDateTime</code></a>.</p>
  
  <p>As mentioned in the XML Schema Definition, dateTime was inspired by ISO 8601. I used <code>OffsetDateTime.parse(s, DateTimeFormatter.ISO_OFFSET_DATE_TIME)</code> to parse the <code>xs:dateTime</code>, which works fine for e.g. </p>
  
  <pre><code>"2007-12-03T10:15:30+01:00" //or
  "2007-12-03T10:15:30Z"
  </code></pre>
  
  <p>Sadly, in <code>xs:dateTime</code> the offset part <a href="https://www.w3.org/TR/xmlschema-2/#dateTime-lexical-representation" rel="noreferrer">is declared optional</a>, so parsing the valid </p>
  
  <pre><code>"2016-03-02T17:09:55"
  </code></pre>
  
  <p>throws an <code>DateTimeParseException</code>.</p>
  
  <p><strong>Is there a <a href="https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html" rel="noreferrer"><code>DateTimeFormatter</code></a> for OffsetDateTime, which also handles unzoned <code>xs:dateTime</code>s (probably with a default timezone)?</strong></p>