java获取上一年当前时间的年月日时分秒
解决方法:
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Calendar c = Calendar.getInstance();
c.setTime(new Date());
c.add(Calendar.YEAR, -1);
String date=sdf.format(c.getTime());
date结果:2021-05-11 09:32:30
向大家推荐《Activiti工作流实战教程》:https://xiaozhuanlan.com/activiti