I want to know the number of days between two dates. When I use the following code it raises an error. How do I fix it?
import org.joda.time.{DateTime, Days}
val start = "2018-10-01 00:00:00"
val end= "2018-10-12 00:00:00"
val from = DateTime.parse(start)
val to = DateTime.parse(end)
println(from + "<>" + to)
println("Number of days between 2 period: " + Days.daysBetween(from, to).getDays)
ERROR:
java.lang.IllegalArgumentException: Invalid format: "2018-10-01 00:00:00" is malformed at " 00:00:00"