0

is there any way to set up database timezone using url properties? Currently it seems to be UTC+2hours but in my test its just UTC, so tests fail because of time difference (Im inserting 00:00 but during verification hour fetched from db is 02:00). I know it can be done by SET TIME ZONE but I dont have any script initializing db in tests, its just liquibase file which is exactly same as for production code.

hi_my_name_is
  • 4,894
  • 3
  • 34
  • 50

1 Answers1

0

You need to set the JVM time zone, as answered here: How to set a JVM TimeZone Properly

Now if you need to test against a database that is running in UTC but your program is not running in UTC, you need to start an HSQLDB server in a separate process running in UTC.

fredt
  • 24,044
  • 3
  • 40
  • 61