use DateUtils;
Edit1.Text:=intToStr(MonthsBetween(StrToDateTime(‘2012-10-2‘),StrToDateTime(‘2012-5-1‘)));Edit1.Text:=intToStr(MonthsBetween(DateTimePicker2.Date,DateTimePicker1.Date));
delphi 计算l两个日期的时间间隔月数,月数差
原文:http://www.cnblogs.com/lantianhf/p/6037401.html