I am trying to convert an array of strings to a Date ArrayList with the following format - "dd/MM/yyyy" I have included my method below. When I print the ArrayList the dates are not formatted correctly and are displayed as: "Thu Mar 05 00:00:00 GMT 2020" Can anyone think why this is happening?
private void convertDates()
{
SimpleDateFormat formatter1=new SimpleDateFormat("dd/MM/yyyy");
for (String dateString : date) {
try {
dateList.add(formatter1.parse(dateString));
} catch (ParseException e) {
e.printStackTrace();
}
}
displayDates.setText(Arrays.toString(dateList.toArray()));
}