How to convert String e.g. "01/01/2019" to date in Java 8 : <p>I'm trying to use Java 8's DateTimeFormatter to turn strings such as "17/01/2019" into dates of exactly the same format.</p>

<p>I'm currently using:</p>

<pre><code>DateTimeFormatter format = DateTimeFormatter.ofPattern("dd/MM/yyyy", Locale.ENGLISH);

LocalDateTime dExpCompletionDate = LocalDateTime.parse(sExpCompletionDate, format);
LocalDateTime dExpCommencementDate = LocalDateTime.parse(sExpCommencementDate, format);
</code></pre>

<p>and getting the error:</p>

<blockquote>
  <p>java.time.format.DateTimeParseException: Text '' could not be parsed at index 0</p>
</blockquote>

<p>Which would suggest there's something wrong with my format.</p>

<p>Currently, I've tried using the default format as well as using LocalDate instead of LocalDateTime</p>
