System.DateTime.ToFileTime Method

Converts the value of the current DateTime object to a Windows file time.

Syntax

public long ToFileTime ()

Returns

The value of the current DateTime object expressed as a Windows file time.

Remarks

A Windows file time is a 64-bit value that represents the number of 100-nanosecond intervals that have elapsed since 12:00 midnight, January 1, 1601 A.D. (C.E.) Coordinated Universal Time (UTC). Windows uses a file time to record when an application creates, accesses, or writes to a file.

The DateTime.ToFileTime method uses the DateTime.Kind property to determine whether the current DateTime object is a local time, a UTC time, or an unspecified kind of time which is treated as a local time.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0