/**
* 获取上一年时间.
*
* @param dealDate 待处理时间
* @return str
*/
private String getLastYearTime(String dealDate) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = null;
try {
date = sdf.parse(dealDate);
} catch (ParseException e) {
LOGGER.error(e.getMessage(), e);
}
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.YEAR, -1);
return sdf.format(calendar.getTime());
}
网友评论