对我来说,最简单的方法是:
Calendar calendar = Calendar.getInstance();calendar.setTime(new Date());SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");//Here you say to java the initial timezone. This is the secretsdf.setTimeZone(TimeZone.getTimeZone("UTC"));//Will print in UTCSystem.out.println(sdf.format(calendar.getTime())); //Here you set to your timezonesdf.setTimeZone(TimeZone.getDefault());//Will print on your default TimezoneSystem.out.println(sdf.format(calendar.getTime()));


