title: I want to get date in given format but this gives me output as 2020-03-65 15:23 instead of 2020-03-05 15:23,what is wrong with the code?
body: <pre><code>public class CurrentDateTimeExample1 {
      public static void main(String[] args) {
          DateTimeFormatter dtf = DateTimeFormatter.ofPattern("YYYY-MMM-DD HH:mm:ss");
          LocalDateTime now = LocalDateTime.now();
          System.out.println(dtf.format(now));
      }
  }
  </code></pre>
  
  <p>//code is provided above that I used to format date </p>