Home  |  Delphi .net Home  |  System.IO.Directory  |  SetLastWriteTime Method
  
SetLastWriteTime  
Method  
Sets the specified Directory (folder) Last Write date and time
Directory Class
System.IO NameSpace
CF1.  Procedure SetLastWriteTime ( PathString : String; DateAndTime : DateTime ) ; Static;
CF : Methods with this mark are Compact Framework Compatible
Description
The last write date and time of the specified absolute or relative PathString directory (folder) is set to the specified DateAndTime value.
Notes
Static methods are not methods of an object - they are simply class functions or procedures available at any time.
Microsoft MSDN Links
System.IO
System.IO.Directory
 Author links

 Buy Website Traffic at
 Buywebsitetrafficexperts.com

 Buy Proxies at
 Buyproxies.io
 
 
 
Creating a folder, and changing the Last Write date
program Project1;
{$APPTYPE CONSOLE}

uses
  System.IO;

var
  Path : String;

begin
  // Create a new folder
  Path := 'C:Delphi testing';
  System.IO.Directory.CreateDirectory(Path);

  // Show the folder last write date and time
  Console.WriteLine(System.IO.Directory.GetLastWriteTime(Path));

  // Change the last write date and time
  System.IO.Directory.SetLastWriteTime(Path, DateTime.Create(2000, 1, 1));

  // Show the folder last write date and time again
  Console.WriteLine(System.IO.Directory.GetLastWriteTime(Path));

  // Delete this temporary folder
  System.IO.Directory.Delete(Path);

  Console.Readline;
end.
   22/09/2004 09:14:50
   01/01/2000 00:00:00
 
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Contact the author