如:date1='2002-10-1',假设函数为func(),
则func(date1,1,'y')='2003-10-1'

解决方案 »

  1.   

    use DateUtils;
    var
      date1:TDateTime;
    begin
      showmessage(datetimetostr(IncYear(date1));
    end;
      

  2.   

    use DateUtils;
    var
      date1:TDateTime;
    begin
      date1 := '2002-10-10';  //少写了一点
      showmessage(datetimetostr(IncYear(date1));
    end;相关的函数:IncMoth
    IncDay
      

  3.   

    谢谢Drate(鸟窝里的虫),好像delphi4中只有incMonth(),不过也可解决我的问题
      

  4.   

    以上的几个函数要uses一个单元,也可以这样作:
    var
      YY,MM,DD:Word;
    begin
      DecodeDate(YourDate,YY,MM,DD);
      YourDate:=EncodeDate(YY+1,MM,DD);
    end;