Home  |  Delphi .net Home  |  System.IO.Directory  |  GetCreationTime Method
GetCreationTime  
Method  
Gets the date and time that the specified Directory was created
Directory Class
System.IO NameSpace
CF1.  Function GetCreationTime ( PathString : String; ) : DateTime; Static;
CF : Methods with this mark are Compact Framework Compatible
Description
The creation date and time of the specified PathString is returned as a DateTime value.
Notes
An exception is thrown if the PathString path is not found.

Static methods are not methods of an object - they are simply class functions or procedures available at any time.
References
DateTime
Microsoft MSDN Links
System.IO
System.IO.Directory
 
 
Create a new Directory and get its creation date and time
program Project1;
{$APPTYPE CONSOLE}

uses
  System.IO;

var
  Path : String;

begin
  Path := 'C:\Dir1\Dir2';

  // Create a nest of 2 new folders
  System.IO.Directory.CreateDirectory(Path);

  // Show the creation date and time
  Console.WriteLine(System.IO.Directory.GetCreationTime(Path));

  // Now delete this nest of folders
  System.IO.Directory.Delete('C:\Dir1', true);

  Console.Readline;
end.
Show full unit code
  21/09/2004 16:31:25
 
 
Delphi Programming © Neil Moffatt All rights reserved.  |  Contact the author