Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Directory.GetLastWriteTimeUtc Method

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

Namespace:  System.IO
Assembly:  mscorlib (in mscorlib.dll)

static member GetLastWriteTimeUtc : 
        path:string -> DateTime

Parameters

path
Type: System.String

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

Return Value

Type: 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.

ExceptionCondition
UnauthorizedAccessException

The caller does not have the required permission.

ArgumentException

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.

ArgumentNullException

path is a null reference (Nothing in Visual Basic).

PathTooLongException

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.

NoteNote

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.

The following example illustrates the differences in output when using Coordinated Universal Time (UTC) output.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Show:
© 2015 Microsoft