星期一, 3月 23, 2009

檔案的時間轉系統時間


function FileTimeToDateTime(var ft: FILETIME): TDateTime;
var
//ft2: FILETIME;
st: SYSTEMTIME;

begin
Result:=0;
if((ft.dwHighDateTime = 0) and (ft.dwLowDateTime = 0)) then
begin
Exit;
end;
//if(not FileTimeToLocalFileTime(ft, ft2)) then
//begin
// Exit;
//end;
//if(not FileTimeToSystemTime(ft2, st)) then
// Exit;
if(not FileTimeToSystemTime(ft, st)) then
Exit;
Result:=SystemTimeToDateTime(st);
end;

沒有留言: