public void countByDate(Timestamp currentMonth){
for(int i =0;i<10;i++){
if(i==0){
Timestamp nextMonth=new Timestamp(currentMonth.getTime());
nextMonth.setHours(23);
nextMonth.setMinutes(59);
nextMonth.setSeconds(59);
}else{
Timestamp ddd=new Timestamp(currentMonth.getTime());
currentMonth.setDate(currentMonth.getDate()-1);
ddd.setDate(currentMonth.getDate());
ddd.setHours(23);
ddd.setMinutes(59);
ddd.setSeconds(59);
}
}
JAVA循环输出近10天的日期
最新推荐文章于 2024-07-11 19:48:22 发布
本文介绍了一种通过Java代码实现的日期范围设置方法,该方法能够根据当前月份生成一系列的截止日期,具体包括当月最后一天及之前的每一天的具体时间。
1064

被折叠的 条评论
为什么被折叠?



