close

[Solved] Cannot deserialize value of type `java.util.Date` from String

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Cannot deserialize value of type java.util.Date from String in java. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Cannot deserialize value of type java.util.Date from String Error Occurs?

Today I get the following error Cannot deserialize value of type java.util.Date from String in java.

How To Solve Cannot deserialize value of type java.util.Date from String Error ?

  1. How To Solve Cannot deserialize value of type java.util.Date from String Error ?

    To Solve Cannot deserialize value of type java.util.Date from String Error The format pattern you have right now expects the sting to have millisecond values – but your example string doesn't have them.

  2. Cannot deserialize value of type java.util.Date from String

    To Solve Cannot deserialize value of type java.util.Date from String Error The format pattern you have right now expects the sting to have millisecond values – but your example string doesn't have them.

Solution 1

Change your @JsonFormat line to this.

@JsonFormat(pattern="yyyy-MM-dd'T'HH:mm:ss")

The format pattern you have right now expects the sting to have millisecond values – but your example string doesn’t have them.

Solution 2

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment