Code: Select all
@UpdateTimestamp
@Column(name = "updated_date")
private LocalDateTime updatedDate;
< /code>
Wenn ich die Antwort in meinem DTO erhalte, versuche ich, die LocalDatetime -Eigenschaft wie diese zu formatieren@JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd'T'HH:mm:ss")
private LocalDateTime updatedDate;
< /code>
, aber ich erhalte einen Fehler in Postman < /p>
"message": "JSON parse error: Cannot deserialize value of type `java.time.LocalDateTime` from String \"2020-04-14T10:45:07.719\": Text '2020-04-14T10:45:07.719' could not be parsed at index 14; nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `java.time.LocalDateTime` from String \"2020-04-14T10:45:07.719\