title: Problem with convert String to LocalDateTime
body: <p>When I run this I get exception:
  Exception in thread &quot;main&quot; java.time.format.DateTimeParseException: Text '2020-12-15 13:48:52' could not be parsed: Invalid value for ClockHourOfAmPm (valid values</p>
  <p>I write to console:  2020-12-15 13:48:52</p>
  <pre><code>public class Main {
      public static void main(String[] args) {
  
  
          Scanner scanner = new Scanner(System.in);
          System.out.println(&quot;Podaj datę:&quot;);
          String input = scanner.nextLine();
  
  
          if (input.matches(&quot;\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}&quot;)) {
              DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern(&quot;yyyy-MM-dd hh:mm:ss&quot;);
              LocalDateTime localDateTime = LocalDateTime.parse(input, dateTimeFormatter1);
              printDateTime(localDateTime);
          } else if (input.matches(&quot;\\d{2}.\\d{2}.\\d{4} \\d{2}:\\d{2}:\\d{2}&quot;)) {
              DateTimeFormatter dateTimeFormatter2 = DateTimeFormatter.ofPattern(&quot;dd.MM.yyyy hh:mm:ss&quot;);
              LocalDateTime localDateTime2 = LocalDateTime.parse(input, dateTimeFormatter2);
              printDateTime(localDateTime2);
          } else if (input.matches(&quot;\\d{4}-\\d{2}-\\d{2}&quot;)) {
              DateTimeFormatter dateTimeFormatter3 = DateTimeFormatter.ofPattern(&quot;yyyy-MM-dd&quot;);
              LocalDateTime localDateTime3 = LocalDateTime.parse(input, dateTimeFormatter3);
              printDateTime(localDateTime3);
          } else {
              System.out.println(&quot;Zły format&quot;);
          }
      }
  
      private static void printDateTime(LocalDateTime localDateTime) {
          System.out.println(&quot;Czas lokalny: &quot; + ZonedDateTime.now());
          System.out.println(&quot;UTC: &quot; + ZonedDateTime.of(localDateTime, ZoneId.of(&quot;UTC&quot;)));
          System.out.println(&quot;Londyn: &quot; + ZonedDateTime.of(localDateTime, ZoneId.of(&quot;London&quot;)));
          System.out.println(&quot;Los Angeles: &quot; + ZonedDateTime.of(localDateTime, ZoneId.of(&quot;Los Angeles&quot;)));
          System.out.println(&quot;Sydney: &quot; + ZonedDateTime.of(localDateTime, ZoneId.of(&quot;Sydney&quot;)));
      }
  }
  </code></pre>