title: Convert string to OffsetDateTime in Java
body: <p>I am trying to convert a string in <code>OffsetDateTime</code> but getting below error.</p>
  
  <p><code>java.time.format.DateTimeParseException: Text '20150101' could not be parsed: Unable to obtain OffsetDateTime from TemporalAccessor: {},ISO resolved to 2015-01-01 of type java.time.format.Parsed</code></p>
  
  <p>Code : <code>OffsetDateTime.parse("20150101", DateTimeFormatter.ofPattern("yyyyMMdd"));</code></p>
  
  <p>Expected output: <code>OffsetDateTime object with date 20150101.</code></p>
  
  <p>I really appreciate any help you can provide.</p>
  
  <p>Thanks,</p>