????????
????1.new Date() ???????????????? ???8??С?
????2.eclipse???????????????????? ???8??С?
????3.log4j????????????????? ???8??С?
?????????????????????????
???????java?????????????????????
??????????????£?
????1.????????????????仰?????TimeZone tz =TimeZone.getTimeZone("Asia/Shanghai");TimeZone.setDefault(tz)
????2.??tomcat?????catalina.bat????? set JAVA_OPTS????????-Duser.timezone=GMT+08
????3.????????е??????????(GMT+08:00) ??????????????????????????3???
????????????п??£?????????????????????????е???HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsNTCurrentVersionTime Zones ???????????????? ??
???????????????????????????
?????????????????????????JAVA???????????????????????£?

Properties props=System.getProperties();
Iteratoriter=props.keySet().iterator();
while(iter.hasNext())??Stringkey=(String)iter.next();
System.out.println(key+" = "+props.get(key));
}

????user.timezone=????JAVA???????????????????????????????????ɡ?
????weblogic :
????????????????????????????JS??DEBUG?????????????????浽??????У????????????????????????????????8??С????????????????????????
?????????????????????????????????????????????
????????????????weblogic?????????...
????weblogic??????????jre?????????jre???????????GMT?????й???????????????GMT+8????????????weblogic???jre?е?GMT???????GMT8???GMT???????????????????????????????GMT????????????г?????????
?????????weblogic??????????????
??????? domians/project/bin/startWebLogic.cmd
???????????
????Xml????
????set JAVA_OPTIONS=%JAVA_OPTIONS%
????[xml] view plaincopy
????set JAVA_OPTIONS=%JAVA_OPTIONS%
???????????? -Duser.timezone=GMT+8 ??????????GMT+8 ???д? Asia/shanghai
???????????
????Xml????
????set JAVA_OPTIONS=%JAVA_OPTIONS% -Duser.timezone=GMT+8
????[xml] view plaincopy
????set JAVA_OPTIONS=%JAVA_OPTIONS% -Duser.timezone=GMT+8
???????棬???????weblogic????????
????????????startWebLogic.cmd
????unix????????
????find / -name mk/??????????????????嵽??????????Ч??-name??????????????
????????????????
????TimeZone tz =TimeZone.getTimeZone("Asia/Shanghai");
????TimeZone.setDefault(tz);
????Date date=new Date();
????String str=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date);
????System.out.println(str);

????????????????????
????SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd kk:mm:ss ");
????sdf.setTimeZone(TimeZone.getTimeZone("GMT+8"));
????Date d = new Date();
????System.out.println(sdf.format(d));
???????????????????

Calendar now = Calendar.getInstance();
now.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));//important
System.out.println(now.get(Calendar.YEAR));
System.out.println(now.get(Calendar.MONTH));
System.out.println(now.get(Calendar.DAY_OF_MONTH));
System.out.println(now.get(Calendar.HOUR_OF_DAY));
????????????????????
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"?? Locale.CHINA);
formatter.setTimeZone(TimeZone.getTimeZone("GMT+8"));
Date currTime = new Date();
String thisTime = new String(formatter.format(currTime));
System.out.println("GMT+8:"+thisTime);
???????????
????String tzId = TimeZone.getDefault().getID();
????System.out.println("TimeZone.getDefault().getID():"+tzId);
???????????
????String zone = System.getProperty("user.timezone");
????System.out.println("user.timezone:"+zone);