C# DateTime FromFileTimeUtc

Description

DateTime FromFileTimeUtc converts the specified Windows file time to an equivalent UTC time.

Syntax

DateTime.FromFileTimeUtc has the following syntax.


public static DateTime FromFileTimeUtc(
  long fileTime
)

Parameters

DateTime.FromFileTimeUtc has the following parameters.

  • fileTime - A Windows file time expressed in ticks.

Returns

DateTime.FromFileTimeUtc method returns An object that represents the UTC time equivalent of the date and time represented by the fileTime parameter.

Example

Converts the specified Windows file time to an equivalent UTC time.


using System;/*ww  w.  ja va 2 s . co m*/
public class MainClass{
  public static void Main(String[] argv){  
    DateTime dt = DateTime.FromFileTimeUtc(12123123123123123);
    System.Console.WriteLine(dt);
  }
}
    

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version