RE: Java not seeing timezone/tomcat displaying times in GMT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



I'm setting export CATALINA_OPTS= "Duser.timezone=America/Los_Angeles"
in my init.d script that starts up the tomcat(haven't set it in
$CATALINA_HOME/bin/setenv.sh)...but will try that as well ....i wrote a
simple java function that print the date, and when I call java foo, it
prints the correct date format. I haven't tried the jsp page, but will
also try that...seems as if tomcat is ignoring everything I set.

-----Original Message-----
From: centos-bounces@xxxxxxxxxx [mailto:centos-bounces@xxxxxxxxxx] On
Behalf Of Jeff Larsen
Sent: Friday, February 08, 2008 8:46 AM
To: CentOS mailing list
Subject: Re:  Java not seeing timezone/tomcat displaying times
in GMT

On Feb 7, 2008 9:12 PM, Isaac Gonzalez <igonzalez@xxxxxxxxxxxxxx> 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
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux