Returns the date and time, in Coordinated Universal Time (UTC) format, that the specified file or directory was last written to.
Assembly: mscorlib (in mscorlib.dll)
- Type: System.String
The file or directory for which to obtain modification date and time information.
Return ValueType: System.DateTime
A structure that is set to the date and time the specified file or directory was last written to. This value is expressed in UTC time.
The caller does not have the required permission.
path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the GetInvalidPathChars method.
path is a null reference (Nothing in Visual Basic).
The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters.
This method may return an inaccurate value, because it uses native functions whose values may not be continuously updated by the operating system.
If the directory described in the path parameter does not exist, this method returns 12:00 midnight, January 1, 1601 A.D. (C.E.) Coordinated Universal Time (UTC).
For a list of common I/O tasks, see Common I/O Tasks.