将日期日转为字符串然后再分解不就可以啦,分解后再将各自的部分转为整型,那不就可以加减咯。date = "2004/02/02";
String []list = date.split("/");int year = Integer.parseInt(list[0]);
int month = Integer.parseInt(list[1]);
int day = Integer.parseInt(list[2]);转了之后你想干什么都可以咯!不对的地方请指教!!

解决方案 »

  1.   

    java.util.Date dt = new java.util.Date(2005,1,18,8,45,30);
    System.out.print(dt.getYear() +1);
    System.out.print(dt.getMonth() +1);
    System.out.print(dt.getDate() +1);
      

  2.   

    使用java.util.Calendar类,里面提供了你需要的功能
      

  3.   

    private static SimpleDateFormat sdfDateOnly = new SimpleDateFormat("yyyyMMdd");
    public static String getBeforeDate(String sDate){
    try{
                               long DAY_MILLI= 24*60*60*1000;
    String rDate="";
    Date dt=toDate(sDate,sdfDateOnly);
    long temp=dt.getTime();
    Date d=new Date(temp-DAY_MILLI);
    rDate=toString(d,sdfDateOnly);
    return rDate;
    }catch(Exception e){
    return "";
    }
    }
    private static String toString(Date dt,SimpleDateFormat formatter){
    String sDate="";
    try{
    if(dt==null)
    sDate = "";
    else
    sDate=formatter.format(dt).toString();
    }catch(Exception e){
    e.printStackTrace();
    }
    return sDate;
    }