Calendar newdate = Calendar.getInstance(); // Collect before this date
Calendar today = Calendar.getInstance();
rdate.setTime(converteddate);
newdate.setTime(converteddate);
newdate.add(Calendar.DATE, 7);
今天如何检查是在rdate
和newdate
之间?
答案 0 :(得分:2)
rdate.after(today)&&rdate.before(newdate)
答案 1 :(得分:0)
您可以尝试以下操作:
(today.after(rdate) && today.before(newdate) ||
(today.after(newdate) && today.before(rdate))
答案 2 :(得分:0)
怎么样
if ( today.after( rdate ) && today.before( newdate ) ) { .... }
假设newdate
总是晚于代码评论所暗示的rdate
。
干杯,