i got the data from in excel file and pet it into an array string, the date is in the format (12/12/2020) whine i print it withe the method toString() i get (12-dec-2020), and when i tried simpledateformat codes that i found i get the errors "unparseable date java" or "SimpleDateFormat Cannot format given Object as a Date" or "The import java.text.SimpleDateFormat cannot be resolved"can anyone help me please? my code:
for (int row =0;row<sheet.getLastRowNum()+1;row ++) {
XSSFRow erow = sheet.getRow(row);
for(int column =0;column<sheet.getRow(0).getLastCellNum();column++) {
XSSFCell ecolumn = erow.getCell(column);
exdata[row][column]= String.valueOf(ecolumn);
}
}
String stringDate = new SimpleDateFormat("MM/yyyy").format(exdata[1][5].toString());
Date date = (Date) new SimpleDateFormat("yyyy-MM-dd").parse(stringDate);
System.out.println(String.valueOf(date));