日期:2014-05-19 浏览次数:20713 次
public boolean judge(){ Calendar c1 = Calendar.getInstance(); Calendar c2 = Calendar.getInstance(); Calendar c3 = Calendar.getInstance(); c1.set(2008,8,7,9,22); c2.set(2008,8,17,9,20); c3.set(2008,8,8,22,20); long l1 = c1.getTimeInMillis(); long l2 = c2.getTimeInMillis(); long l3 = c3.getTimeInMillis(); if(l3>l1&&l3<l2){ return true; }else{ return false; } }
------解决方案--------------------
可以转换成 GregorianCalendar,再利用其方法比较
不过还是用long 比较方便些
如3楼的方法