In TrueNAS-13.0-U6.1 in a jail I installed java, but now I get the wrong clock time in java. Observe the following:
So this shows I am in central europe timezone, which is correctly set up. But now just using jshell I get
So Java does not honor the time zone in TrueNAS and shows GMT and therefore the time is offset??
How to get corret clock time in Java in TrueNAS?
Code:
# date Sat Feb 10 10:36:35 CET 2024
So this shows I am in central europe timezone, which is correctly set up. But now just using jshell I get
Code:
# java -version openjdk version "19.0.2" 2023-01-17 OpenJDK Runtime Environment (build 19.0.2+7-1) OpenJDK 64-Bit Server VM (build 19.0.2+7-1, mixed mode, sharing) # jshell | Welcome to JShell -- Version 19.0.2 | For an introduction type: /help intro jshell> java.time.ZonedDateTime.now() $3 ==> 2024-02-10T09:38:12.192401862Z[GMT] jshell> java.time.LocalDateTime.now() $1 ==> 2024-02-10T09:38:12.192401862Z
So Java does not honor the time zone in TrueNAS and shows GMT and therefore the time is offset??
How to get corret clock time in Java in TrueNAS?
Last edited: