How to get the current date without time in scala
calendar, date, datetime, scala
Solution
You may use formatting:
val format = new SimpleDateFormat("d-M-y")
println(format.format(Calendar.getInstance().getTime()))
Problem
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.