1.CST转GMT解决时间差问题
public static String getGMT(Date dateCST) {
if(dateCST!=null){
DateFormat df = new SimpleDateFormat("EEE, d-MMM-yyyy HH:mm:ss z", Locale.ENGLISH);
df.setTimeZone(TimeZone.getTimeZone("GMT+8")); // modify Time Zone.
return(df.format(dateCST));
}
return "";
}
GMT转CST
public static Date getCST(String strGMT) throws ParseException {
DateFormat df = new SimpleDateFormat("EEE, d-MMM-yyyy HH:mm:ss z", Locale.ENGLISH);
return df.parse(strGMT);
}