Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
function FileAge(const aFileName: string): Integer;
Returns the system time stamp of a file.
The return value can be converted to a TDateTime object using the FileDateToDateTime function.
var aFile : string;
aFileDateTime : TDateTime;
aFileOSDate : integer;
begin
aFile : = Application.ExeName;
aFileOSDate := FileAge(aFile);
if aFileOSDate = -1 then Exit; //invalid file
aFileDateTime := DateAdd(Now,1); //add a day
FileSetDate(aFile, DateTimeToFileDate(aFileDateTime));
//Fo, our application exe file "was" modified tomorow
end;
|
Your first MP3 Delphi player
See how to build a full-blown mp3 player with Delphi in just a few seconds. Even more: get the ID3 tag information from a mp3 file and change it!
TDateTime,
DateTimeToFileDate,
FileDateToDateTime,
|
Free Delphi code snippet inside every Delphi Newsletter! |
|
|
|
Got some code to share? Got a question? Need some help? |
|
|