赞
踩
}
/**
*距离当前时间七天之内的日期,和七天之外的日期
* @param dt
* @param type
* type:1--7天之内的
* type:2--7天之外的
* @return
*/
public static boolean getDayDiffFromToday(Date dt,int type){
Date today=new Date();
today.setHours(23);
today.setMinutes(59);
today.setSeconds(59);
long diff = today.getTime() - dt.getTime();
if(diff<0)diff=0;
long days = diff/(1000*60*60*24);
if(type==1 && days>0 && days<=7)return true;
if(type==2 && days>7)return true;
return false;
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。