public class TestDateTransform {
public static void main(String[] arg) throws ParseException{
String ti = “2017-10-10T17:33:03”;
SimpleDateFormat df = new SimpleDateFormat(“yyyy-MM-dd’T’hh:mm:ss”);
df.setTimeZone(TimeZone.getTimeZone(“GMT+8:00”));
SimpleDateFormat mdf = new SimpleDateFormat(“yyyy-MM-dd hh:mm:ss”);
System.out.println(mdf.format(df.parse(ti)));
}
public static void main1() throws ParseException{
String ti = "2017-10-10T17:33:03+8:00";
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ssXXX");
SimpleDateFormat mdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
System.out.println(mdf.format(df.parse(ti)));
}
}