System.IO.Directory.GetLastWriteTimeUtc Method

Returns the date and time, in Coordinated Universal Time (UTC) format, that the specified file or directory was last written to.

Syntax

public static DateTime GetLastWriteTimeUtc (string path)

Parameters

path
The file or directory for which to obtain modification date and time information.

Returns

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.

Remarks

Note:

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.

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0