In this article we will discuss how to change the time zone of the tomcat java application.
By default tomcat comes with the following setting in tomcat.conf:
wrapper.use_system_time=FALSE
This will configure the java to run using the same timezone configured in within the application declaration.
By changing wrapper.use_system_time=FALSE to
wrapper.use_system_time=TRUE
we can force the tomcat to use the same timezone configured on the server side.
If we want to configure a custom timezone for the java, apart from the system (let's say we want logging in different timezone) we keep the previous setting to false the following parameters can be defined in the tomcat.conf file
wrapper.java.additional.4=-Duser.timezone=Europe/Belfast
The location of the tomcat.conf file is usually at this location /etc/tomcatX/tomcat.conf
Make sure you restart your tomcat service after any change made to tomcat.conf file.