How to change the time zone in Jenkins?

soundararajan.c picture soundararajan.c · Feb 13, 2017 · Viewed 38.2k times · Source

I wish to change the time zone of the Jenkins.

I have changed the time zone of the Jenkins installed server, but the Jenkins UI shows the different time.

I need to set the PST time for Jenkins UI. How can I do it?

Answer

Ben Steinert picture Ben Steinert · May 29, 2017

On Jenkins2 you can set the timezone at runtime via the Groovy Console. Just open "Manage Jenkins >> Script Console" and type

System.setProperty('org.apache.commons.jelly.tags.fmt.timeZone', 'America/Los_Angeles')

for example. Particularly helpful if you have no chance to change the startup variables but have admin rights on the instance. (often found in containerized setups). Only downside: Setting is gone on restart.