I am getting the following error on Date deserialization in Java:
com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `java.util.Date` from String "22-09-2020T05:08:05+0000": not a valid representation (error: Failed to parse Date value '22-09-2020T05:08:05+0000': Cannot parse date "22-09-2020T05:08:05+0000": not compatible with any of standard forms ("yyyy-MM-dd'T'HH:mm:ss.SSSX", "yyyy-MM-dd'T'HH:mm:ss.SSS", "EEE, dd MMM yyyy HH:mm:ss zzz", "yyyy-MM-dd"))
My input date is in this format 22-09-2020T05:08:05+0000
I am using
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy'T'HH:mm:ssZ")
OffsetDateTime lastAnalysisDate;
How to resolve this error ? Inspite of using custom JsonFormat
, the error message says it is not of the standard data types.
I am using the date formatter validation tool online https://javadevtools.com/simpledateformat
And the format I specified is valid as per this evaluation tool