Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For some reason, the timestamp in my Tomcat logs is off. The system clock is correct, and set to PST, but the Tomcat logs appear to be using GMT. I haven't been able to find this setting anywhere...hoping someone can shed some light.


share|improve this question
What version of Tomcat? – Matt Nov 18 '09 at 18:16
It's version 6.0.20 – Thody Nov 18 '09 at 19:22

The JVM might have the wrong timezone set as a default.

Add a JVM option -Duser.timezone=US/Pacific (use the JAVA_OPTS property)

(also do a ps | grep java to look at the JVM command line and see if this option is already set for UTC, perhaps by a configuration setting or environment variable).

share|improve this answer

Most logging systems default to UTC. This keeps them readable across timezones.
It also allows you to mix logs from different timezones where applicable.

share|improve this answer
I suppose that makes sense, although having Apache and Tomcat logging with different timezones, and the application correcting to yet another timezone makes troubleshooting a pain. – Thody Nov 18 '09 at 17:12
@Thody, I agree with that. Which is why everything should be in UTC and can be externally converted if necessary. Things get into trouble once timezones are introduced. – nik Nov 18 '09 at 17:21

Has the timezone of the system changed since Tomcat was started? I've had problems where Tomcat picks up the timezone when it first starts, and then refuses to accept a new reality until you kill it and start again.

share|improve this answer
Nope, the system time has remained the same. I've actually restarted Tomcat several times as well. – Thody Nov 18 '09 at 17:11

Java has its own implementation of the tzdata.
For instance, in my ubuntu servers, java's timezone definitions are in /usr/lib/jvm/java-6-sun-
While the system one are under /usr/share/zoneinfo/

You can specify which timezone java should use by passing the option -Duser.timezone=$TZ where $TZ is the relative path to the timezone file under zi
for example: -Duser.timezone=Etc/GMT+3

share|improve this answer
It's better to use the named time zone rather than GMT+3. This allow for proper handling daylight savings time. In other words, use US/Pacific instead of GMT-8. – Will Glass Jan 1 '10 at 18:36

It appears that Java uses the value in /etc/sysconfig/clock as the timezone value when starting up. On my system that was:


Change that value to what you want and restart tomcat.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.