I have a "May 07, 2015" string. I want to convert it to DateTime format as 2015-05-07 pattern .
I have converted as follows:
scala> val format = new java.text.SimpleDateFormat("MMM dd, yyyy")
format: java.text.SimpleDateFormat = java.text.SimpleDateFormat@2e2b536d
scala> format.parse("May 07 2015")
res5: java.util.Date = Thu May, 07 00:00:00 IST 2015
What should be the next step to convert the above int 2015-05-07 without writing a map to convert the months to their corresponding numeric values?