将日期转化为 数字表示,(这样表示 自从1970 0 00 以来所经历的秒数字)(好象是的,具体你可以考证一下) 然后用数字操作来得到日期。。
这里有参考代码
Date dt1= rs.getDate()..  //可以从数据库中读取。
long l = dt1.getTime() 。。//取得秒数
至于万年历,网上有好多写好的js的.Java都有。搜索一下吧。

解决方案 »

  1.   

    那么,JAVA中有没有现成的库函数可以完成这个功能呢?
      

  2.   


    public int getDay()Returns the day of the week represented by this date. The returned value (0 = Sunday, 1 = Monday, 2 = Tuesday, 3 = Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday) represents the day of the week that contains or begins with the instant in time represented by this Date object, as interpreted in the local time zone. public int getDate()Returns the day of the month represented by this Date object. The value returned is between 1 and 31 representing the day of the month that contains or begins with the instant in time represented by this Date object, as interpreted in the local time zone.
      

  3.   

    另外还有setDay(),setDate(),不要我都跟你贴出来了吧!!
      

  4.   

    getDate()
    我的意思是:
    开始日期是03/5/3,要经过4天能完成,
    那么通过getDate()可以得到四天后的日期是03/5/7吗?
      

  5.   

    有个笨办法。
    用getTime()方法把日期转着自1970以来的秒数,加上4天的秒的数试试。
      

  6.   

    java.util.Date dt=new java.util.Date();
    dt.setDate(dt.getDate()+4); // 不用多解释了吧