Delphi中有沒有如"2002/06/01"與"2002/04/01"相差几個月份的函數.[
]
var
SecDate, FirDate: TDateTime;
SecYear, SecMonth, SecDay: Word;
FirYear, FirMonth, FirDay: Word;
begin
SecDate:= StrToDate('2002/08/01');
FirDate:= StrToDate('2002/04/01');
DecodeDate(SecDate, SecYear, SecMonth, SecDay);
DecodeDate(FirDate, FirYear, FirMonth, FirDay);
Label1.Caption := '2002/08/01--2002/04/01相差: ' + IntToStr(SecMonth - FirMonth)
'个月.';
end;