i am trying to read CSV file .In CSV file expiry date column is "23-Feb-23"
but when it is read using buffered reader or any method it is read as "23/FEB/23" . And when i tried to parse it it's not at all possible and is giving
Caused by: java.time.format.DateTimeParseException: Text '23/FEB/23' could not be parsed at index 3
below is code i used:
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("dd-MMM-yy");
String exp = record.get("expiry");
LocalDate expiry = null;
if (null != exp && !"".equals(exp)) {
expiry = LocalDate.parse(exp, dateTimeFormatter);
}
i also tried pattern dd/MMM/yy and that also didn't worked.