long x=strDate.getTime()-spupdate.getTime();
int day=x/1000*60*60*24;
if(x>3)
{
返回index.jsp
}

解决方案 »

  1.   

    long x=strDate.getTime()-spupdate.getTime();
    int day=x/1000*60*60*24;
    if(x>3)
    {
    返回index.jsp
    out.close();
    }
      

  2.   

    能说说day=x/1000*60*60*24;是什么意思好么
      

  3.   

    x是微秒值,day=x/1000*60*60*24;也就是天数了~
      

  4.   

    用mtou(逆风) 的方法,字符串转可相比较的时间类型,好象就getTime()方法,其他的我没见过~
      

  5.   

    long x=strDate.getTime()-spupdate.getTime();
    int day=x/1000*60*60*24;strDate.getTime()获得strDate 的毫秒值
    long x等到两个时间的毫秒差
    1000*60*60*24一天的毫秒值