title: How to differentiate when "second field" is missing in LocalDateTime
body: <p>I am given <code>LocalDateTime</code> object created from <code>String</code>. I want to check whether that original string has "seconds" parameter or not.
  My two inputs are:</p>
  
  <pre><code>String a = "2016-06-22T10:01"; //not given
  String b = "2016-06-22T10:01:00"; //not given
  
  LocalDateTime dateA = LocalDateTime.parse(a, DateTimeFormatter.ISO_DATE_TIME);
  LocalDateTime dateB = LocalDateTime.parse(b, DateTimeFormatter.ISO_DATE_TIME);
  </code></pre>
  
  <p>Problem is I am given <code>dateA</code> and <code>dateB</code>, not <code>a</code> and <code>b</code>.</p>
  
  <p>I have tried various ways like converting <code>LocalDateTime</code> to <code>String</code> and finding its length. For that I used two approaches.</p>
  
  <pre><code>date.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME).length();
  date.toString().length();
  </code></pre>
  
  <p>But first approach gives length 19 for both <code>dateA</code> and <code>dateB</code>  whereas second approach gives length 16 for both <code>dateA</code> and <code>dateB</code>.</p>
  
  <p>I am unable to find any way to differentiate <code>dateA</code> and <code>dateB</code>.  </p>