SimpleDateFormat dft = new SimpleDateFormat("yyyy-MM-dd");
Date beginDate = new Date();
Calendar date = Calendar.getInstance();
date.setTime(beginDate);
date.set(Calendar.DATE, date.get(Calendar.DATE) - 1);
Date endDate = dft.parse(dft.format(date.getTime()));
减几天都可以 !
java 获取当前时间,将天数减一天,返回Date.
最新推荐文章于 2024-09-23 11:45:10 发布