Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

time zone problem with tomcat.

Status
Not open for further replies.

tick

Programmer
Jul 31, 2001
4
HK
Hi

My time zone is set as

root_juliet# echo $TZ
Australia/NSW

However, tomcat appears to want to use the EDT timezone;

from tomcat log;

root_juliet# 07:34:29 EDT - ContextManager: Adding context Ctx( /onsale )
07:34:29 EDT - ContextManager: Adding context Ctx( /examples )
Starting tomcat. Check logs/tomcat.log for error messages
07:34:29 EDT - ContextManager: Adding context Ctx( )
07:34:29 EDT - ContextManager: Adding context Ctx( /calendar )
07:34:29 EDT - ContextManager: Adding context Ctx( /old_admin )
07:34:29 EDT - ContextManager: Adding context Ctx( /test )
07:34:33 EDT - PoolTcpConnector: Starting HttpConnectionHandler on 8090
07:34:33 EDT - PoolTcpConnector: Starting Ajp12ConnectionHandler on 8007

I've tried explicitly setting the format in server.xml, but to no avail.

any Java bean or jsp using time via tomcat uses the EDT timezone, but if i run a java prog outside of tomcat, the correct AET timezone is used, so the problem appears to be limited to my tomcat configuration.

I can force the time zone inside my java beans;

TimeZone timeZone = TimeZone.getTimeZone("AET");
//cat.error("TimeZone="+timeZone.getID());

cal = Calendar.getInstance();
cal.setTimeZone(timeZone);

but this does not solve the problem whereby the log time stamp is wrong.

Can anyone help ?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top