0

From RabbitMQ getting below JSON

{"PlateNo":"A125","DeviceId":"D152","Time":"/Date(1584260162000)/","Latitude":25.59483611111111,"Longitude":56.30596666666667,"Address":"Dibba, Fujairah, UAE","GPSSpeed":0,"IsValid":false}

After ObjectMapper,

How to format the Time2020欧洲杯时间表 field in the spring boot?

| |
1

2020欧洲杯时间表on date field use below annotation :-

@JsonFormat(
  shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd@HH:mm:ss.SSSZ", locale = "en_GB")

and use below dependency :-

<dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-databind</artifactId>
    <version>2.9.4</version>
</dependency>
| |
  • get below error: Cannot deserialize value of type java.time.LocalDateTime from String "/Date(1584260162000)/": Failed to deserialize java.time.LocalDateTime: (java.time.format.DateTimeParseException) Text '/Date(1584260162000)/' could not be parsed at index 0 – Fazlan Ahamed Mar 19 at 9:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy2020欧洲杯时间表

Not the answer you're looking for? Browse other questions tagged or ask your own question.