How to get the current date without time in scala
You may use formatting:
val format = new SimpleDateFormat("d-M-y")
println(format.format(Calendar.getInstance().getTime()))
scala> java.time.LocalDate.now
res4: java.time.LocalDate = 2014-07-11
Since Java 8, you can also use LocalDate
class:
println(java.time.LocalDate.now)
OR
java.time.LocalDate.now.toString