⑴ 如何使用java將GMT轉換為UTC格式
String toGMT(Date date) {
try {
SimpleDateFormat format = new SimpleDateFormat(
"yyyy-MM-dd HH:mm:ss");
Calendar cal = Calendar.getInstance(new SimpleTimeZone(0, "GMT"));
format.setCalendar(cal);
return format.format(date);
} catch (ParseException e) {
e.printStackTrace();
}
}