/**
* @Title: 时区转换0->+8区 东八区
* @Description:
* @author pengbin <pengbin>
* @date 2020/4/10 12:11
* @param
* @return
* @throws
* pattern -> yyyy-MM-dd HH:mm:ss
*/
public static String changeZoneE8(String strDate,String pattern) {
String str = "-";
try {
String fromTimeZone = "GMT+0";
String toTimeZone = "GMT+8";
SimpleDateFormat format = new SimpleDateFormat(pattern);
format.setTimeZone(TimeZone.getTimeZone(fromTimeZone));
Date date = format.parse(strDate);
format.setTimeZone(TimeZone.getTimeZone(toTimeZone));
strDate = format.format(date);
str = strDate;
System.out.println(str);
} catch (ParseException e) {
e.printStackTrace();
}
return str;
}