C# DateTimeOffset FromFileTime
Description
DateTimeOffset FromFileTime
converts the specified
Windows file time to an equivalent local time.
Syntax
DateTimeOffset.FromFileTime
has the following syntax.
public static DateTimeOffset FromFileTime(
long fileTime
)
Parameters
DateTimeOffset.FromFileTime
has the following parameters.
fileTime
- A Windows file time, expressed in ticks.
Returns
DateTimeOffset.FromFileTime
method returns An object that represents the date and time of fileTime with the offset set
to the local time offset.
Example
The following example uses the DateTimeOffset.FromFileTime
method.
using System;// w ww . ja v a2 s. com
using System.IO;
using System.Runtime.InteropServices;
public class FileTimes
{
public static void Main()
{
Console.WriteLine(DateTimeOffset.FromFileTime(999999999999L).ToString());
}
}
The code above generates the following result.