DateTimeToFileDate
Moduł: SysUtils
function DateTimeToFileDate(DateTime: TDateTime): Integer;
Konwertuje datę zapisaną w postaci typu TDateTime na postać 32-bitową w postaci liczby Integer. Parametr tego typu wymagany jest np. w funkcji FileSetDate która ustawia datę modyfikacji pliku:
program Foo;
uses Dialogs, SysUtils;
var
S : String;
FileHandle : Integer;
begin
if PromptForFileName(S) then
begin
FileHandle := FileOpen(S, fmOpenWrite);
try
FileSetDate(FileHandle, DateTimeToFileDate(Now));
finally
FileClose(FileHandle);
end;
end;
end.
Zobacz też: