title: To convert Date into YYYY-MM-DD HH:MM:SS
body: <p>If I give the input as any date format.I want to convert it into YYYY-MM-DD HH:MM:SS</p>
  <p>I wrote the code as:</p>
  <p>The input format will be any of them below:</p>
  <pre><code>DateTimeFormatter inputformats=DateTimeFormatter.ofPattern(&quot;[dd-MMM-uuuu hh:mm]&quot;,&quot;[dd-MMM-uuuu hh:mm:ss.s]&quot;,&quot;[uuuu-MM-dd hh:mm:ss]&quot;,&quot;[dd-MM-uuuu hh:mm:ss]&quot;&quot;[uuuu-MM-dd]&quot;).withResolverStyle(ResolverStyle.STRICT);
  
      
  try {
      LocalDateTime localDate = LocalDateTime.parse(value, inputformats);
      value = localDateTime.format(outputformat);
      return value;
  
  } catch (DateTimeParseException e) {
      log.error(e);
      return null;
  }
  </code></pre>
  <p>And I give the input as:&quot;26-08-1990 10:12:11&quot;. But I am getting the &quot;could not be parsed: unable to obtain localDateTime from temporalaccessor&quot; this error</p>