title: Java 8 DateTimeFormatter
body: <p>I need to replace SimpleDataFormat with Java 8 DateTimeFormatter. Below is the code with SimpleDateFormat.</p>
  
  <pre><code>DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
          Date date = sdf.parse(source);
  </code></pre>
  
  <p>Now I need to change it to DateTimeFormatter. I tried as below</p>
  
  <pre><code>LocalDateTime ld = LocalDateTime.now();
  DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
  Date startdate = dtf.parse(dtf);
  </code></pre>
  
  <p>Now this is generating exception.</p>