I have to parse String to Date format(dd.MM.YYYY).
Here is my code:
Date date = null;
try {
date = new SimpleDateFormat("dd.MM.yyyy").parse(regDate);
} catch (Exception e) {
System.out.println(e);
}
System.out.println(date);
But the output is: Tue Oct 12 00:00:00 EEST 2021. How can I change my code to print the date in the required format?