title: How to get datetime with and without an offset?
body: <p>Currently my method is able to parse and format date and time with an offset. </p>
  
  <p>While I experienced with JUnit I discovered -for many people pretty obvious- mistake that I'm only able to parse it if it contains an offset. </p>
  
  <p>I either get
  <code>Unable to obtain OffsetDateTime from TemporalAccessor</code> or I can't parse time with an offset.</p>
  
  <p>This is my code so far:</p>
  
  <p>Working input:
   <code>"2020-01-12T10:30-06:00"</code></p>
  
  <p>Not working input:
  <code>"2020-01-12T10:30"</code></p>
  
  <pre><code>OffsetDateTime offsetDateTime = OffsetDateTime.parse(date, buildIso8601Formatter());
  Instant instant = offsetDateTime.toInstant();
  
  return LocalDateTime.ofInstant(instant, ZoneOffset.UTC);
  </code></pre>
  
  <p>It works fine for datetimes with an offset but not the other way around.</p>
  
  <p>In the end I want to be able to parse a datetime with/without an offset in the same method.</p>