[Solved] Openfeign Error: error: Failed to parse Date value…

1 date conversion problem

1. Error reporting

error: Failed to parse Date value '2021-09-13 23:59:59': Cannot parse date "2021-09-13 23:59:59": while it seems to fit format 'yyyy-MM-dd'T'HH:mm:ss.SSSZ', parsing fails (leniency?null))

2. solution

Add the annotation of date format deserialization on the field attribute @ jsonformat (pattern = "yyyy MM DD HH: mm: SS")

	/**
     * the end of time
     */
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date endDate;

Read More: