I currently develop a project with Hibernate and WildFly. The database I'm using is a mariaDB.
When I insert a java.time.Instant
into the database, the JPA applies two hours on the inserted timestamp (which is always UTC in the java code).
I tried to start WildFly with -Duser.timezone=UTC
in the standalone.conf (Java Opts) and command-line argument. The management console shows this timezone, but all log-output and database inputs are in my system timezone (+2). When I set my Windows timezone to UTC, the odd behaviour stops and the times in the database are correct.
I also tried to set the hibernate property <property name="hibernate.jdbc.time_zone" value="UTC"/>
and on my mariaDB SET GLOBAL time_zone = "+00:00"
which didn't work as well.
What am I missing here?