C# File SetCreationTimeUtc

Description

File SetCreationTimeUtc Sets the date and time, in coordinated universal time (UTC), that the file was created.

Syntax

File.SetCreationTimeUtc has the following syntax.


public static void SetCreationTimeUtc(
  string path,
  DateTime creationTimeUtc
)

Parameters

File.SetCreationTimeUtc has the following parameters.

  • path - The file for which to set the creation date and time information.
  • creationTimeUtc - A DateTime containing the value to set for the creation date and time of path. This value is expressed in UTC time.

Returns

File.SetCreationTimeUtc method returns

Example

The following example demonstrates SetCreationTimeUtc.


//from   w  ww  .j av  a2s  .  c  o  m

using System;
using System.IO;

class Test 
{
    public static void Main() 
    {
      string path = @"c:\Temp\MyTest.txt";
      File.SetCreationTimeUtc(path, new DateTime(2014,4,3));
    }
}




















Home »
  C# Tutorial »
    System.IO »




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