I need to deserialize below two foramt into java.time.Instant
in a singe code
2020-04-23T10:51:24.238+01:00
and
2019-11-11T15:44:10.201Z
我在第一种情况下出现belwow错误
nested exception is org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize value of type java.time.Instant
from String "2020-04-23T10:51:24.238+01:00": com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type java.time.Instant
from String "2020-04-23T10:51:24.238+01:00": Failed to deserialize java.time.Instant: (java.time.format.DateTimeParseException) Text '2020-04-23T10:51:24.238+01:00' could not be parsed at index 23
Is there any solution ?
Also Is there any way to deserialize java.util.Date
into java.time.Instant
了解您的API: