0

I'am using a localDate to store a date coming from a client like this dd/MM/yyyy hh:mm:ss I use the Json format to manage this date. But i have this error:

JSON parse error: Cannot deserialize value of type `java.time.LocalDate` from String "06/11/2018 17:01:35": Failed to deserialize java.time.LocalDate

here is my class

@Entity

public class Audit implements Serializable{

/**
 * 
 */
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String username;
@JsonFormat(pattern="dd/MM/yyyy HH:mm:ss")
private LocalDate loginDate;
Syllaba Abou Ndiaye
  • 213
  • 1
  • 7
  • 21
  • 1
    I would like to know the right pattern that i should use – Syllaba Abou Ndiaye Nov 06 '18 at 16:24
  • 2
    See https://stackoverflow.com/questions/40327970/deserialize-java-8-localdatetime-with-jacksonmapper –  Nov 06 '18 at 16:25
  • 4
    Possible duplicate of [Deserialize Java 8 LocalDateTime with JacksonMapper](https://stackoverflow.com/questions/40327970/deserialize-java-8-localdatetime-with-jacksonmapper) – Majid Nov 06 '18 at 16:29

0 Answers0