var
theday:Tdate;
str:string;
begin
theday:=encodedate(2000,5,31)
//获得日期‘2000-5-31’
theday:=incmonth(theday,-3)
//将其减掉2个月,看看减了几天
str:= datetostr(theday);
form1.Canvas.TextOut(100,100,str);
end;
答案是::::‘2000-2-29’,不是‘2000-2-31’
显然,若 theday:=incmonth(theday,-2),也就是到3月分,结果就是
‘2000-3-31’,可见他的函数以近帮你全处理好了,不必你去担心。