获取前一天的时间
// 前一天时间
Date data = new Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(data);
calendar.add(Calendar.DAY_OF_YEAR, -1);
Date time = calendar.getTime();
2024-03-22 17:02:46
获取前一天的时间
// 前一天时间
Date data = new Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(data);
calendar.add(Calendar.DAY_OF_YEAR, -1);
Date time = calendar.getTime();