title: Finding days difference between dates in Android Kotlin
body: <p>So, I already search on google and most of them using Java, there is one using Kotlin and often using different time format than what I used (yyyy-mm-dd HH:mm:ss).<br>
  So I tried to code and stuck.<br>
  So, here is the code :</p>
  
  <pre><code>import java.time.LocalDateTime
  import java.time.temporal.ChronoUnit
  
  fun main(args : Array&lt;String&gt;) {
  
      // 2019-05-24 14:17:00 | 2019-09-13 14:15:51
      val start = "2019-05-24 14:17:00"
      val end = "2019-09-13 14:15:51"
  
      daysBetweenDates(start, end)
  }
  
  
  fun daysBetweenDates(start: String, end: String) {
      val mStart = LocalDateTime.parse(start)
      val mEnd = LocalDateTime.parse(end)
  
      val difference = ChronoUnit.DAYS.between(mStart, mEnd)
      println("START =&gt; $mStart")
      println("END =&gt; $mEnd")
      println("DIFFERENCE =&gt; $difference days")
  }
  </code></pre>
  
  <p>But I got an error :</p>
  
  <pre><code>Exception in thread "main" java.time.format.DateTimeParseException: Text '2019-05-24 14:17:00' could not be parsed at index 10
      at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1949)
      at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1851)
      at java.time.LocalDateTime.parse(LocalDateTime.java:492)
      at java.time.LocalDateTime.parse(LocalDateTime.java:477)
      at MainKt.daysBetweenDates(main.kt:16)
      at MainKt.main(main.kt:11)
  </code></pre>