List of usage examples for java.time LocalDateTime parse
public static LocalDateTime parse(CharSequence text)
From source file:org.ojbc.adapters.analyticsstaging.custody.processor.AbstractReportRepositoryProcessor.java
protected LocalDateTime parseLocalDateTime(String dateTimeString) { try {/* ww w. j ava 2 s . co m*/ if (StringUtils.isNotBlank(dateTimeString)) { if (dateTimeString.length() > 19) { dateTimeString = dateTimeString.substring(0, 19); } return LocalDateTime.parse(dateTimeString); } else { log.error("The dateTimeString can not be blank"); } } catch (DateTimeParseException e) { log.error("Failed to parse dateTimeString " + dateTimeString, e); } return null; }