I want to convert a date into "yyyy-MM-dd". I am using
val parser = SimpleDateFormat("dd-MMM-yyyy") // The original format
val formatter = SimpleDateFormat("yyyy-MM-dd")
val output = formatter.format(parser.parse(etDOB.text.toString()))
as given here. But Android studio is warning me to use SimpleDateFormat(String, Locale). Which locale should I use to get output into "yyyy-MM-dd"?
Or is there a better way to achieve this (API 21)? I also have the date in a calendar instance.