6

Whenever I persist LocalDate to MySQL Database, the Date is stored one day off (11 Nov 2017 becomes 10 Nov 2017). I've already tried to set the timezone in the application on MySQL server and set the legacyDateTimeCode to false but the problem still exists. Any idea on how to fix it? If I switch to local h2 Database, the Date is stored correctly.

Spring-boot-starter-parent: 1.5.7 hibernate 5.2.10 mysql: 5.7 LocalDate stored in DATE field

nikiforovpizza
  • 434
  • 7
  • 13
Ceryni
  • 341
  • 1
  • 5
  • 17

1 Answers1

1

Add spring.jpa.properties.hibernate.jdbc.time_zone : UTC In Properties file

Naveen
  • 29
  • 4