PhysiologyWeb Logo  Search
Share on Facebook Share on Twitter Share on LinkedIn Share on Pinterest Email Copy URL
PhysiologyWeb Loading...

Get File Last Write/Modification Date and Time
Here is a simple Delphi function that takes a file name as its input, and returns the date and time the file was last modified (i.e., last write/modification date/time stamp). For additional Delphi code for the Windows operating system, see Useful Delphi Code for the Windows Operating System.
function GetFileLastWriteDateTime(FileName: String): TDateTime;
GetFileLastWriteDateTime := 0;

If (FileName <> '') and (FileExists(FileName) = True) then
GetFileLastWriteDateTime := TFile.GetLastWriteTime(FileName);
//TFile record is found in the IOUtils unit

Posted: Saturday, May 20, 2023