Hello!
I recently downloaded JDK 1.1.6 v2, and I have problems getting it
correctly interpret the timezone setting on my machine. Since I live
in Sweden, my timezone is "MET DST", however this seems to confuse
java. The time returned from Date() is 2 1/2 hours ahead of the local
time (?). However, if I make the timezone GMT or UTC or something more
"common", it seems to work as it should. Still, it doesn't recognize
any offset, i.e. "GMT +2" or something similar.
Is this a linux specific quirk, or is it a general bug in java?
Below is a small test program to print out the current date and time
for reference. It would be nice if someone else living in my area
and using the same timezone could try this out and report to me how
it goes.
I am using linux 2.0.33, gcc 2.7.2.3 and libc 5.4.44 if that would
make any difference.
Thankful for any help.
Mats Petersson
--------------------------------------------------------------------------
import java.util.*;
import java.text.*;
class DateTest {
public static void main (String args[]) {
Date dummy = new Date();
SimpleDateFormat df = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy");
String curdate = df.format(dummy);
System.out.println(curdate);
}
}
--------------------------------------------------------------------------