//本地時區與GMT格林威治標準時間的偏移量(北京是東八區 相差的毫秒數是28800000)
TimeZone.getDefault().getRawOffset();
Date nowTime =
new Date();
System.out.println(
"如今的時間: " + nowTime);
SimpleDateFormat matter1 =
new SimpleDateFormat(
" 'time ': yyyy-MM-dd HH:mm:ss z ");
matter1.setTimeZone(TimeZone.getTimeZone(
"GMT "));
System.out.println(
"如今的時間: " + matter1.format(nowTime));
/** *matter1.getCalendar().getTime().getTime()+(long)TimeZone.getDefault().getRawOffset() == nowTime.getTime(); * 成立 */