Set default timezone H2 database

前端 未结 6 1501
谎友^
谎友^ 2020-12-16 00:46

How can I explicitly set the time zone H2 should use? Now it gets the timezone to use from the underlying OS. I would assume there existed an extra parameter I would add to

6条回答
  •  粉色の甜心
    2020-12-16 01:06

    What helped me was to set timezone config for JDBC instead of JVM, which also seems more reasonable and cleaner way, as it affects only the database instead of the whole JVM:

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

    My answer to the other question might help with additional info.

提交回复
热议问题