function TForm_MEA_CHG.isEffectsDate(astrdatetime:string):Boolean; //判断是不是有效的时间
var
jstrYear,jstrMonth,jstrday:string;
IMonth:integer;
begin
Result:=true;
jstrYear:=Copy(astrdatetime,1,4);
jstrMonth:=Copy(astrdatetime,5,2);
jstrDay:=Copy(astrdatetime,7,2);
if (jstrMonth='01') or (jstrMonth='03') or (jstrMonth='05') or (jstrMonth='07')
or (jstrMonth='08') or (jstrMonth='10') or (jstrMonth='12') then
begin
IMonth:= 31;
end
else if (jstrMonth='04') or (jstrMonth='06') or (jstrMonth='08') or (jstrMonth='11') then
begin
IMonth:= 30;
end
else if ((StrToInt(jstrYear) mod 4 = 0) and (StrToInt(jstrYear) mod 100 <> 0)) or (StrToInt(jstrYear) mod 400 = 0) then
IMonth:= 29
else
IMonth:= 28;
if StrToInt(jstrday)>IMonth then
begin
Result:=False;
end;
end;