Set default timezone H2 database

前端 未结 6 1509
谎友^
谎友^ 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:10

    You can manipulate the JVM time zone, before interacting with the database:

    TimeZone.setDefault(TimeZone.getTimeZone("UTC"))
    

    Unfortunately, H2 does not support time zone per connection... yet.

提交回复
热议问题