Jeroen Siffels wrote:
> 
> Dear Reader,
> <...>
> I'm running on a Pentium based system Linux 2.0.36 with JDK 1.1.6. My
> problem is that when I use the data command om the commandline
> (/bin/date) the date I see is corrent, but when I use in Java 'Data d =
> new Date()'. The reported time is one hour late. In Linux the CET is
> reported (I live in the Netherlands) as wanted but Java reports the UTC.
> How can I make my Java software report the localtime without making my
> code timezone depended (addind one hour is not a wanted solution) ?
> 
> Thanx in advance,
> 
> Jeroen

I had a similar problem some time ago with Linux/JDK1.1.6v2 and
Solaris/JDK1.1.6.
I think it was fixed at least in Linux/1.1.6v5.
The problem was that the VM and the java classes did not agree about the
short name
for the time zone Central European. I don't know any more, possibly the
Timezone class used ECT for European Central Time? Or the VM ignored
the CET timezone and set GMT?
So you can install a newer JDK where the Timezone class and the VM
agree.
If you don't want to do this, you can work around setting
the user.timezone property explicitly.
I did this in the java.wrapper script in the jdk1.1.6/bin directory:

  opts=${opts}" -Duser.timezone=ECT" # or CET ?


Hope this helps!


-- 
Martin Sorgatz
[EMAIL PROTECTED]

Reply via email to