Calendar cd = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US); sdf.setTimeZone(TimeZone.getTimeZone("GMT")); // 设置时区为GMT String str = sdf.format(cd.getTime());System.out.println(str);