views:

60

answers:

2

Hello All, I have a windows server 2003 machine, installed on it, a cisco product called "Cisco Voice Portal", this product runs on JRE version 1_5_0_12. Getting the date/time either by:

new Date();

or

Calendar.getInstance();

always the date is one hour ahead of the system date. At first, i thought it is a timezone mismatch, however this is the output of printing the date object:

Fri Oct 08 02:36:38 EST 2010

and the system clock is also in EST timezone. which means that timezones are the same. The system date is the correct one, the system machine is is Sydney, Australia. Any suggestions to fix this? Thanks in advance.

+2  A: 

First of all, the JRE has it's own database of timezone information and it may or may not differ from the one on your native platform.

Another problem that you might have is that when launching a JRE, you may have specified either a locale or a timezone that is different than that of your host platform, which will also cause this type of behavior.

PS: You might want to read this FAQ entry from Oracle (ex. Sun) on how platform and JVM timezones are (not) related.

Roland Tepp
Frankly, i didn't know that JRE and system clocks are independent. regarding the facs page you referred to, it is very interesting. however i already tried the tzupdater tool but it didn;t fix the problem, As Purush pointed below, there is a bug in using tzupdater tool on version 1.5.0_12.
guirgis
Also i didn't find any locale-specific parameters on execution scripts. I replaced the files in "jre/lib/zi/Australia" with those of version 1.6 but didn't have any luck. Any suggestions? Thanks for your interest.
guirgis
+1  A: 

Did you try upgrading to newer JRE version? Refer to bug 6595137, which seems to be fixed in 1.5.0_13.

Purush Rudrakshala
Unfortunately, I can't do this, the JRE is embedded in the product.
guirgis
Does replacing the files in jre/lib/zi/Australia with new ones (say from java 1.6), will fix this issue, as i cannot upgrade the whole JRE? Thanks
guirgis