public Long fundata( Date brithday )
{
//获取当前日期
Date nowDate = new Date();
//转为毫秒值进行换算
long nowSecond = nowDate.getTime();
long birthdaySecond = brithday.getTime();
//计算
long second = nowSecond-birthdaySecond;
if(second<0) {
return null;
}else {
return second/1000/60/60/24;
}
}
指定日期到当前日期的天数
最新推荐文章于 2022-04-24 20:08:31 发布