antd time selector data format

The front-end page uses antd's time selector, and then always reports an error when transmitting the time:

Caused by: com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type java.util.Date from String “2020-08-04T02:04:17.727Z”: expected format "yyyy-MM-dd HH:mm:ss"

The time format of the back-end entity class is
Insert picture description here
. The requirements in the database actually only use year, month and day, instead of hours, minutes and seconds,
so the backend changes the time format to the
Insert picture description here
front-end time selector control, and there is an attribute of formatting. Time value,
Insert picture description here
then I also added this attribute to the component.
Insert picture description here
The data format of the front and back ends must be consistent. After setting, the time can be successfully submitted.

Guess you like

Origin blog.csdn.net/weixin_39040527/article/details/107780843