W
Wendy S
On HP-UX, we've always used 'MST7' for our timezone, and we've had no
problems until a recent move to JDK 1.5. Suddenly, all the Tomcat logs and
the webapps thought they were in GMT.
Did something officially change in the format that Java wants for timezones?
Or was 'MST7' always wrong, and it just now decided to bite us? The server
admin claims that MST7 is valid, and 'date' continues to return the correct
date and time at the prompt.
The following executes a Java program that does nothing but
System.out.println( new java.util.Date() );
under four different JDK/timezone combinations:
$ ./time.sh
JAVA_HOME is /opt/java1.4
TZ is MST7
Tue Jan 25 16:33:01 GMT-07:00 2005
JAVA_HOME is /opt/java1.4
TZ is MST
Tue Jan 25 16:33:04 MST 2005
JAVA_HOME is /opt/java1.5
TZ is MST7
Tue Jan 25 23:33:09 GMT 2005 <--- WRONG!
JAVA_HOME is /opt/java1.5
TZ is MST
Tue Jan 25 16:33:13 MST 2005
$
problems until a recent move to JDK 1.5. Suddenly, all the Tomcat logs and
the webapps thought they were in GMT.
Did something officially change in the format that Java wants for timezones?
Or was 'MST7' always wrong, and it just now decided to bite us? The server
admin claims that MST7 is valid, and 'date' continues to return the correct
date and time at the prompt.
The following executes a Java program that does nothing but
System.out.println( new java.util.Date() );
under four different JDK/timezone combinations:
$ ./time.sh
JAVA_HOME is /opt/java1.4
TZ is MST7
Tue Jan 25 16:33:01 GMT-07:00 2005
JAVA_HOME is /opt/java1.4
TZ is MST
Tue Jan 25 16:33:04 MST 2005
JAVA_HOME is /opt/java1.5
TZ is MST7
Tue Jan 25 23:33:09 GMT 2005 <--- WRONG!
JAVA_HOME is /opt/java1.5
TZ is MST
Tue Jan 25 16:33:13 MST 2005
$