I have been used Spring Date Rest with Spring Boot in my project.
This project has a object and I have used the annotation @JsonFormat to format the date field that will be received from my Json.
The format of field Date is "dd/MM/yyyy".
When I send in my json the value "08/07/1980" the Jackson convert to the value "07/07/1980".
The problem is that @JsonFormat set the date with one day less
This is my source code
@Temporal(TemporalType.DATE)
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd/MM/yyyy", locale = "pt-BR", timezone = "UTC")
private Date birthDate;
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…