Skip to content
Advertisement

JSON parse error: Cannot deserialize value of type `java.time.LocalDateTime` from String

I am sending request to external service which has updatedDate property

JavaScript

When I receive the response in my DTO I am trying to format the LocalDateTime property like this

JavaScript

But I get error in Postman

JavaScript

Advertisement

Answer

There are milliseconds in the input string, so your format should be “yyyy-MM-dd’T’HH:mm:ss.SSS”

Update: If the millisecond part consists of 1, 2, 3 digits or is optional, you may use the following format:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement