In a Java 8 project, I can parse the date this way:
LocalDate.parse(
newDateString,
DateTimeFormatter.ofPattern(expectedDateFormat)
)
.format(
DateTimeFormatter.ofPattern(expectedDBDateFormat)
);
My problem is that I have a Java 6 project, and LocalDate
and DateTimeFormatter
are not defined for Java 6.
How can I parse the date in my Java 6 project?