C# FileInfo LastWriteTimeUtc

Description

FileInfo LastWriteTimeUtc Gets or sets the time, in coordinated universal time (UTC), when the current file or directory was last written to.

Syntax

FileInfo.LastWriteTimeUtc has the following syntax.


[ComVisibleAttribute(false)]
public DateTime LastWriteTimeUtc { get; set; }

Example

Gets the time, in coordinated universal time (UTC), when the current file or directory was last written to.


/*w  w w .j av a 2  s  .  c o m*/
using System;
using System.IO;

public class DirectoryTest 
{
    public static void Main() 
    {
        FileInfo fi = new FileInfo("temp.txt");

        Console.WriteLine(fi.LastWriteTimeUtc);
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.IO »




BinaryReader
BinaryWriter
Directory
DirectoryInfo
DriveInfo
File
FileInfo
FileStream
MemoryStream
Path
StreamReader
StreamWriter
StringReader
StringWriter