I am running Jenkins on a Linux server and shows the wrong time :(
Situation: I am running another java app (in tomcat that also runs Jenkins) that shows the correct time in the log files (I use Logback through slf4j). The bios is set to the UTC time (system clock) like advises here: http://www.linuxsa.org.au/tips/time.html
In Linux it's indicated in /etc/sysconfig/clock that the system clock is set to UTC and in which timezone we are located. I am in UTC+1
Running date command on Linux shows the correct local time. Example: Sun Jan 8 12:11:35 CET 2012 But Jenkins shows the time plus 1 hour :(...
The jenkins config shows: user.timezone = Europe/Amsterdam (which is UTC+1).
I think that Jenkins (java) thinks the local clock is set to UTC such that 1 hour is added.
How do I solve this?
To see the time zone currently set, go to jenkins_server/systemInfo and see the user. timezone system property. You may want to change the time zone displayed to match your own time zone. By going to your user configuration page, you can set the User Defined Time Zone to match your own.
Add a Schedule to a Jenkins JobHead back to the job configuration and click the Build Triggers tab. Now, check the Build periodically box in the Build Triggers section. This will open the scheduling text area. Next, let's set the job to run every five minutes.
If you are running Jenkins with Docker, you can append -e JAVA_OPTS=-Duser.timezone=TZ
to docker arguments.
docker run -e JAVA_OPTS=-Duser.timezone=$TZ jenkins
All available TZ
can be found here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With