GWTで日本時間の表示

GWTで日本時間を取得するにはCalendarインスタンスタイムゾーン、Local指定で取得し、さらにそのあとにsetTimezoneする必要があるみたい。

SimpleDateFormat format = new SimpleDateFormat("yyyy年M月d日 HH:mm:ss");
TimeZone timezone = TimeZone.getTimeZone("Asia/Tokyo");
Locale locale = Locale.JAPAN;
Calendar calendar = Calendar.getInstance(timezone, locale);
//■↓これがないとNG
calendar.setTimeZone(timezone);
//表示
System.out.println(calendar.getTime());
format.setTimeZone(timezone);
String strDate = format.format(calendar.getTime());
//整形して表示
System.out.println(strDate);