How to set correct MySQL JDBC timezone in Spring Boot configuration

前端 未结 11 1296
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-14 01:28

DB:

$ mysql --version
mysql  Ver 14.14 Distrib 5.6.27, for osx10.10 (x86_64) using  EditLine wrapper

Spring Boot: 2.1.1.RELEASE

The

11条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-14 02:16

    Another way is to put into the file application.properties the next line:

    spring.jpa.properties.hibernate.jdbc.time_zone=UTC
    

    It comes as an option in: https://www.baeldung.com/mysql-jdbc-timezone-spring-boot

提交回复
热议问题