I'm using LocalDateTime.now() and OffSetDateTime.now() to retrieve the date and time but it's not the desired format.
Does anyone know how to format this format? "2022-05-20T11:22:10"
I'm using MapStruct to do request and response conversions:
@Mapper
public interface ParesMapper {
ParesMapper INSTANCE = Mappers.getMapper(ParesMapper.class);
@Mapping(target = "data", source = "data")
DataParesResponse toResponse(DataPares domain);
@Mapping(target = "data", source = "data")
List<DataParesResponse> toResponseList(List<DataPares> domain);
DataPares toDomain(DataParesRequest dto);
default OffsetDateTime map(LocalDateTime value) {
return OffsetDateTime.now();
}
default LocalDateTime map(OffsetDateTime value) {
return LocalDateTime.now();
}
}
I look forward to helping you find a solution.