GetCreationTime(Path: String): DateTime;
Path - directory, date and time of creation of which must be obtained.
The GetCreationTime method returns date and time of directory creation.
Sub UserProc(sPath: String);
Var
Culture: ICultureInfo;
d: DateTime;
Begin
If Directory.Exists(sPath) Then
Culture := CultureInfo.Current;
d := Directory.GetCreationTime(sPath);
Debug.WriteLine("Date and time of directory creation: " +
Culture.FormatLongDate(d) + Culture.FormatTime(d));
End If;
End Sub UserProc;
On executing the example it is checked if the directory specified in the sPath parameter is present in the file system. If the directory exists, date and time of its creation are displayed in the development environment console.
See also: