How can I change the timezone in Tomcat? The timezone used by one of the webapps (Solr) is not right (compared to MySQL timestamps), and I think changing Tomcat's timezone will help. Thanks!
Here is what I add at beginning of catalina.sh
(after shabang) to change tomcat's timezone:
TOMCAT_TIMEZONE="-Duser.timezone=Europe/Budapest"
CATALINA_OPTS="$CATALINA_OPTS $TOMCAT_TIMEZONE"
And don't forget to restart tomcat to take effect.
As said Eric Wang you may use
TOMCAT_TIMEZONE="-Duser.timezone=Europe/Budapest"
CATALINA_OPTS="$CATALINA_OPTS $TOMCAT_TIMEZONE"
but on CentOS server I didn't find catalina.sh, instead of that I added these variables to /etc/sysconfig/tomcat6, and that's works!
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