如何判断日期不相差三个月 如何判断两个日期不相差三个月 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public boolean isLess90Days(Date d1,Date d2){ return Math.abs(d1.getTime()-d2.getTime())<24*60*60*1000*90;} 多谢tg008007x3, 应该就像下面这个代码一样, Date startDate = employee.getJoinDate(); Date endDate = employee.getResignDate(); Calendar endCalendar = Calendar.getInstance(); endCalendar.setTime(endDate); endCalendar.add(Calendar.MONTH, -3); if (endCalendar.getTime().before(startDate)) { addActionError("The interval of start date and end date should no more than 3 months"); } start.add(Calendar.MONTH, 3);if(start.befor){System.out.println("相隔没有3个月!!");{else System.out.println("至少相隔3个月"); start.add(Calendar.MONTH, 3);if(start.befor(end)){System.out.println("相隔没有3个月!!");{else System.out.println("至少相隔3个月"); 如何用Properties类实现多名用户名登录? 真的是郁闷`谁能帮下啊`急死人了 JAVA如何实现两个对象同步运行 JMX:The MBean class could not be loaded...救命 急聘IT业人才 Applet怎么读不了文件的内容? 不好意思想学JAVA,但对概念实在不清~~~请教一下~ 初学者请教 javaMail与jaf(回复有分) 怎样配置jbuild和borland appserver 协同工作? webservice调用asmx的问题 java G:\TDDOWNLOAD\1\1\34234234\TestCircle 为什么出错?
return Math.abs(d1.getTime()-d2.getTime())<24*60*60*1000*90;
}
Date endDate = employee.getResignDate();
Calendar endCalendar = Calendar.getInstance();
endCalendar.setTime(endDate);
endCalendar.add(Calendar.MONTH, -3);
if (endCalendar.getTime().before(startDate)) {
addActionError("The interval of start date and end date should no more than 3 months");
}
start.add(Calendar.MONTH, 3);
if(start.befor){
System.out.println("相隔没有3个月!!");{
else System.out.println("至少相隔3个月");
if(start.befor(end)){
System.out.println("相隔没有3个月!!");{
else System.out.println("至少相隔3个月");