0

I user hibernate+spring+mysql 5.7. When I save date 20/04/1939, it stores correctly in database.

@Column(name = "birth_date")
    @Temporal(TemporalType.DATE)
    private Date birthDate;

the value stored in database after save is 1939-04-20.

when i display it using

person.getBirthDate()

it displays 19/04/1939. It is not related with my formatting. The value it retrieves from db is one day less.

It is always showing 1 day less when i use year 1939 with any date. So what's wrong here? Also for other years, dates are showing perfectly.

Arvind Kumar Avinash
  • 71,965
  • 6
  • 74
  • 110
TanvirChowdhury
  • 2,498
  • 23
  • 28

1 Answers1

0

updating the database timezone solved this issue.

TanvirChowdhury
  • 2,498
  • 23
  • 28
  • can you describe what exactly you did to solve the problem please, I have the same problem. – tchiko Jan 12 '23 at 11:05