Im trying to parse date 31-MAR-22 16:49 with this method, but it doesn't works
it throws java.time.format.DateTimeParseException: Text '30-MAR-22 16:49' could not be parsed at index 3
I passed hard coded date "30-Mar-22 16:49" instead of "30-MAR-22 16:49" diff is "Mar" and it worked. I have to know which pattern is used to convert MAR
getConvertedDates(date: String?): String {
val format = "MMM d"
val formatter = DateTimeFormatter.ofPattern("dd-MMM-yy HH:mm")
val parsedDate = formatter.parse(date)
val displayFormatter = DateTimeFormatter.ofPattern(format)
return displayFormatter.format(parsedDate).toString()
}