Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

275
Visualizações
Jackson is changing date to one day old in spring boot rest application.

I have created a simple application with spring boot 1.5.2. I am passing date and already mentioned the date format in application.properties file as follwoing : spring.jackson.joda-date-time-format=yyyy-MM-dd

But while calling the rest rest service using any client for POST(Insert) or PUT(Update), date is changing to on day old. Example 2017-03-21 will change to 2017-03-20.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I had the same issue and I solved it in that way: In your entitiy, add theses annotations:

@Temporal(TemporalType.DATE)
@JsonFormat(shape = JsonFormat.Shape.STRING, locale = "fr-FR", timezone = "Europe/Paris")
private Date yourDate;

Or you can add theses line to application.properties file:

spring.jackson.time-zone=Europe/Paris
spring.jackson.locale=fr_FR

If you are in another country you can change locale and timezone, but even if you keep France, it will work.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda