Trying to convert string to localDateTime and see if the date is older than a year. I know it should work but it's not working. Getting parsing exceptions at index 'i'
LocalDateTime currentTimeLastYear = LocalDateTime.now().minusYears(1);
String pattern = "MM/dd/yyyy'T'HH:mm:s";
// ex "8/30/2019T15:51:5"
String queryToDate = query.getDateRange().getToDate();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
LocalDateTime localDateTime = LocalDateTime.parse(queryToDate, formatter);
System.out.println(localDateTime);
if(localDateTime.isBefore(currentTimeLastYear)) {
return true;
}