先不说这个函数被deprecated,只说说原因如果你要指2005.5.31和2005.6.1这2个日期,应该是
    Date dtDay1 = new Date(2005-1900, 5-1, 31);
    Date dtDay2 = new Date(2005-1900, 6-1, 1);

解决方案 »

  1.   

    public Date(int year,int month,int date)
    year - the year minus 1900.
    month - the month between 0-11.  
    date - the day of the month between 1-31你的2个日期是3905.6.31(没有31号,会被处理为3905.7.1)
                 3905.7.1 (所以2个相同)
      

  2.   

    上面其实说了原因
    其实java中的这个类的月份是个很奇怪的东西
    你设的月份是5,其实代表的6月份,因为外国人的月份是从0月开始的你上面的日期其实是6月31号和7月1号
    我们知道6月是没有31号的,那么返回的时间就是6月30号后面一天,也就是7月1号了
    多仪结果是一样的
      

  3.   

    deprecated....
    不要用了。