I am trying to convert a string in OffsetDateTime
but getting below error.
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 : OffsetDateTime.parse("20150101", DateTimeFormatter.ofPattern("yyyyMMdd"));
Expected output: OffsetDateTime object with date 20150101.
I really appreciate any help you can provide.
Thanks,