自定义一个函数,
function GetDateToStr1(const TmpDateTime:TDateTime):AnsiString;
var
AYear, AMonth, ADay: Word;
a:AnsiString;
begin
DecodeDate(TmpDateTime,AYear, AMonth, ADay);
a:=IntToStr(Ayear);
if AMonth<10 then
a:=a+'0'+IntToStr(AMonth)
else
a:=a+IntToStr(AMonth);
if ADay<10 then
a:=a+'0'+IntToStr(ADay)
else
a:=a+IntToStr(ADay);
Result:=a;
end;
应该可以解决你的问题!