JSON parse error: Cannot deserialize value of type `java.util.Date` from String \"2023-03-10 10:00:00\": not a valid representation (error: Failed to parse Date value '2023-03-10 10:00:00': Cannot parse date \"2023-03-10 10:00:00\": while it seems to fit format 'yyyy-MM-dd'T'HH:mm:ss.SSSZ', parsing fails (leniency? null)); nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `java.util.Date` from String \"2023-03-10 10:00:00\": not a valid representation (error: Failed to parse Date value '2023-03-10 10:00:00': Cannot parse date \"2023-03-10 10:00:00\": while it seems to fit format 'yyyy-MM-dd'T'HH:mm:ss.SSSZ', parsing fails (leniency? null))\n at [Source: (PushbackInputStream); line: 3, column: 18] (through reference chain: com.example.springboot.domain.OrderDto[\"createDate\"]) 需要加上配置:
#时区,默认为格林尼治时间,即少8小时,所以我们需要+8标签:10,00,springboot,03,parse,报错,2023,Date From: https://www.cnblogs.com/tiancai/p/17203231.html
spring.jackson.time-zone=GMT+8
#时间格式转换定义
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss