title: Why DateTimeFormatter doesn't work without optional separator after year?
body: <p>Can someone help me understand why below works,</p>
  <pre><code>DateTimeFormatter dateTimeFormat = DateTimeFormatter.ofPattern(&quot;yyyy[-]MM[-]dd['T']HH[:]mm[:]ss['Z']&quot;);
  System.out.println(dateTimeFormat.format(dateTimeFormat.parse(&quot;2021-0108190739&quot;)));
  </code></pre>
  <p>But, below, does not work,</p>
  <pre><code>DateTimeFormatter dateTimeFormat = DateTimeFormatter.ofPattern(&quot;yyyy[-]MM[-]dd['T']HH[:]mm[:]ss['Z']&quot;);
  System.out.println(dateTimeFormat.format(dateTimeFormat.parse(&quot;20210108190739&quot;)));
  </code></pre>
  <p>Following exception is generated,</p>
  <pre><code>Caused by: java.time.format.DateTimeParseException: Text '20210108190739' could not be parsed, unparsed text found at index 0
      at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1952)
      at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1777)
      at Scratch.main(scratch_5.java:9)
      ... 5 more
  </code></pre>
  <p>Are there any workarounds?</p>