title: Parse String for unknown TemporalAccessor
body: <p>I'm getting a request parameter with unknown temporal (date, time or timestamp in ISO format) and want to parse it into a <code>java.time.temporal.TemporalAccessor</code>:</p>
  
  <ul>
  <li><code>LocalDate</code> when the string represents a date like <code>"2018-02-28"</code></li>
  <li>or <code>LocalDateTime</code> when the string represents a timestamp like <code>"2018-02-28T11:20:00"</code></li>
  </ul>
  
  <p>The following attempt results into <code>DateTimeParseException</code>:</p>
  
  <pre><code>TemporalAccessor dt = DateTimeFormatter.ISO_DATE_TIME.parseBest(str, LocalDateTime::from, LocalDate::from);
  </code></pre>
  
  <p>Deciding on the length of the string or the occurrence of a "T", which <code>DateTimeFormatter</code> to use, seems to me a little bit hacky. As well as trying one format after another.</p>
  
  <p>Any better solution?</p>