I have a microservice written in Java + using Spring Boot. I developed it on Windows 10 using Java version 1.8.0_221. Now I want to run this on Ubuntu 18.04. On Ubuntu machine I have OpenJDK 1.8.0_40-b25.
When I run this on Windows machine the time displayed on console messages(I print them using log4j2) and time of stuff I save on database(using @CreatedDate and @Temopral(TemporalType.TIMESTAMP) annotation on a Date field) is correct and my ZoneId.systemDefault is Europe/Istanbul.
It is also Europe/Istanbul on my Ubuntu machine.
However when I run this on Ubuntu machine the time is 1 hour behind the system time I get by typing "date" on terminal. All the times on logs I print to console and my database insertions are off by one hour.
I have searched other similar questions but they all focused on timezones, I don't think in any part of the program I am modifying the timezone. Also my Ubuntu time being correct makes me thing I need to change something with JVM maybe?