title: java.time.format.DateTimeParseException: Text could not be parsed at index 3
body: <p>I am using Java 8 to parse the the date and find difference between two dates.</p>
  
  <p>Here is my snippet:</p>
  
  <pre><code>String date1 ="01-JAN-2017";
  String date2 = "02-FEB-2017";
  
  DateTimeFormatter df = DateTimeFormatter .ofPattern("DD-MMM-YYYY", en);
  LocalDate  d1 = LocalDate.parse(date1, df);
  LocalDate  d2 = LocalDate.parse(date2, df);
  
  Long datediff = ChronoUnit.DAYS.between(d1,d2);
  </code></pre>
  
  <p>When I run I get the error: </p>
  
  <blockquote>
    <p>java.time.format.DateTimeParseException: Text could not be parsed at index 3</p>
  </blockquote>