/**
* 时间转换
* @param data
* @return
*/
public String getValidDateStr(Date data) {
String sDate = "";
SimpleDateFormat sdf1 = new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy", Locale.UK);
try {
Date date = sdf1.parse(sdf1.format(data));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
sDate = sdf.format(date);
} catch (ParseException e) {
logger.error("日期装换方法是把:" + data + "******" + e);
}
return sDate;
}
转载于:https://www.cnblogs.com/austinspark-jessylu/p/5924080.html