I wrote the following program:
import sun.security.action.GetPropertyAction;
import java.security.AccessController;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
public class Main {
public static void main(String[] args) {
System.out.println(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss Z").format(new Date()));
System.out.println(TimeZone.getDefault().getDisplayName());
String country =AccessController.doPrivileged(new GetPropertyAction("user.country"));
System.out.println(country);
String javaHome=AccessController.doPrivileged(new GetPropertyAction("java.home"));
System.out.println(javaHome);
}
}
Then I set a GMT+3 Europe/Minsk timezone on my computer.
If I run this program with JDK6 latest release, I see that it shows me that my timezone in Java is Venezuela standard time GMT+4.30 If I run it on latest JDK7 release, it shows me Brazilian timezone GMT-3, If I run it on latest JDK8 release, it shows me Moskow time GMT+3. If I select a Volgograd GMT+3 timezone on my Win7 computer, the program works correctly in all versions of java. So is it a bug in JDK with Minsk timezone?