IBM vs Oracle/Sun JDK,java.util.Timzone 表现不同,
IBM JDK 1.5 与 Sun/Oracle JDK 1.6
import java.util.*;
class TimeTest {
public static void main(String args[]){
long now = System.currentTimeMillis();
System.out.println("EST : " + TimeZone.getTimeZone("EST").getOffset(now));
System.out.println("US/Eastern : " + TimeZone.getTimeZone("US/Eastern").getOffset(now));
}
}
***IBM JVM ouput
EST : -14400000
US/Eastern : -14400000
Oracle JVM
EST : -18000000
US/Eastern : -14400000
IBM JDK
java -version
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build pxi32devifx-20090811 (SR10 +IZ56666+IZ56751))
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Linux x86-32 j9vmxi3223-20090707 (JIT enabled)
J9VM - 20090706_38445_lHdSMr
JIT - 20090623_1334_r8
GC - 200906_09)
JCL - 20090811
Oracle JDK
java -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) Client VM (build 19.1-b02, mixed mode, sharing)
更新,使用 IBM JDK 6 测试,它匹配 oracle/sun java -version java version "1.6.0" Java(TM) SE Runtime Environment (build pxi3260sr6ifix-20091015_01(SR6+152211+155930+156106)) IBM J9 的输出VM(构建 2.4,JRE 1.6.0 IBM J9 2.4 Linux x86-32 jvmxi3260sr6-20091001_43491(启用 JIT,启用 AOT)J9VM - 20091001_043491 JIT - r9_20090902_1330ifx1 GC - 20090817_AA_)JCL01 - 2
java TimeTest
EST : -18000000
US/Eastern : -14400000***