I am reading text and storing the dates as LocalDate variables.
Is there any way for me to preserve the formatting from DateTimeFormatter so that when I call the Lo
Just format the date while printing it out:
public static void main(String[] args) {
LocalDate date = LocalDate.now();
DateTimeFormatter formatters = DateTimeFormatter.ofPattern("d/MM/uuuu");
String text = date.format(formatters);
LocalDate parsedDate = LocalDate.parse(text, formatters);
System.out.println("date: " + date);
System.out.println("Text format " + text);
System.out.println("parsedDate: " + parsedDate.format(formatters));
}