FileDateTime Function |
Microsoft.VisualBasic.FileSystem
FileDateTime( pathname )
The filename, along with an optional drive and path
A Date containing the date and time at which the specified file was created or last modified (whichever is later)
Obtains the date and time at which a particular file was created or last modified (whichever is later)
If you don't specify a drive or folder with pathname , the file is assumed to be in the current drive or folder.
Use the File.Exists method (in the System.IO namespace) to determine that the file exists before calling FileDateTime . If pathname does not exist, your application generates runtime error 53, "File not found."
If a file has not been modified, its creation date and last modified date will be identical. However, if the file has been modified since its creation, the FileDateTime function returns only the last modified date. To obtain the file's creation date, you have to resort to using the Window's API. The GetFileTime API call returns not only the date last modified, but the file's creation date and last access date as well.
You can also use FileDateTime on hidden files.
File.Exists Method