com.jslsolucoes.spring.converter.LocalDateTimeConverter Maven / Gradle / Ivy
package com.jslsolucoes.spring.converter;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import org.apache.commons.lang3.StringUtils;
import org.springframework.core.convert.converter.Converter;
public class LocalDateTimeConverter implements Converter {
@Override
public LocalDateTime convert(String value) {
if (StringUtils.isEmpty(value)) return null;
return LocalDateTime.parse(value, DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm:ss"));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy