On Feb 7, 2008 9:12 PM, Isaac Gonzalez igonzalez@autoreturn.com wrote:
Any ideas how to force tomcat to display directory listing in local time zone format of my cent box instead of GMT.
I tried all suggestions here: http://marvinlee.wordpress.com/2008/02/01/java-timezone-setting-in-cento s-for-asiakuala_lumpur/
except I use PST8PDT for the timezone....i believe I'm using this as my timezone as this is what appears in /etc/localtime file. When using date command it displays in correct format from bash prompt.
I don't know exactly what PST8PDT is, but Java prefers the full names for time zones like US/Central or US/Pacific
Have you tried something like -Duser.timezone=US/Pacific on the java command line that launches tomcat. You can add that to JAVA_OPTS in $CATALINA_HOME/bin/setenv.sh
Is your tzdata package in CentOS up to date?
Then again, I haven't done much with directory listings in Tomcat, so there may be a different issue at work here. Can you create a simple JSP page that writes java.util.TimeZone.getDefault().toString() and see what you get?
-- Jeff