var
StartDate, EndDate : TDateTime;
DiffDate : Double;
year1,month1,day1 : Word;
year2,month2,day2 : Word;
begin
StartDate := StrToDate('2005-05-15'); <-+-- 이부분은 시스템 제어판의 국가별 설정의 날짜 형식에 따라 사용방법이 달라집니다.
EndDate := StrToDate('2003-07-01'); <-+
ShowMessage('StartDate = '+DateToStr(StartDate));
ShowMessage('EndDate = '+DateToStr(EndDate));
DiffDate := EndDate - StartDate;
ShowMessage('EndDate - StartDate = ' + FloatToStr(DiffDate)+' days');
DecodeDate(StartDate, year1, month1, day1);
DecodeDate(EndDate, year2, month2, day2);
ShowMessage(IntToStr(year1 - year2)
+ '년'
+ IntToStr(month1 - month2)
+ '개월'
+ IntToStr(day1 - day2)
+ '일');