How to get the current date without time in scala

Govind Singh picture Govind Singh · Jul 11, 2014 · Viewed 71.5k times · Source

I want to get the current date so I used:

Calendar.getInstance().getTime()

But as it .getTime() it is returning:

Fri Jul 11 15:07:03 IST 2014

I want only date in any format but without the time.

Answer

Knut Arne Vedaa picture Knut Arne Vedaa · Jul 11, 2014
scala> java.time.LocalDate.now
res4: java.time.LocalDate = 2014-07-11