function GetCuttentDate(Format: Ansistring): AnsiString;
var
NowTime: _SYSTEMTIME;
TempStr: AnsiString;
begin
GetSystemTime(NowTime);
Format:=StringReplace(Format,'yy',IntToStr(NowTime.wYear),[rfIgnoreCase]);
Format:=StringReplace(Format,'mm',IntToStr(NowTime.wMonth),[rfIgnoreCase]);
Format:=StringReplace(Format,'dd',IntToStr(NowTime.wDay),[rfIgnoreCase]);
Format:=StringReplace(Format,'hh',IntToStr(NowTime.wHour),[rfIgnoreCase]);
Format:=StringReplace(Format,'mm',IntToStr(NowTime.wMinute),[rfIgnoreCase]);
Format:=StringReplace(Format,'ss',IntToStr(NowTime.wSecond),[rfIgnoreCase]);
Format:=StringReplace(Format,'ms',IntToStr(NowTime.wMilliseconds),[rfIgnoreCase]);
Result:=Format;
end;
//调用示例:
ShowMessage(GetCuttentDate('yy年mm月dd日hh时mm分ss秒ms毫秒'));