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.

a_horse_with_no_name
  • 497,550
  • 91
  • 775
  • 843
hi_my_name_is
  • 4,694
  • 2
  • 29
  • 48

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
  • 23,296
  • 3
  • 39
  • 61