SystemTimeToFileTime (coredll)
Last changed: JasonK.Handleman-208.44.117.10

.
Summary
Converts a Structure.SystemTime a Structure.FileTime.

C# Signature:

[DllImport("coredll.dll", CallingConvention = CallingConvention.Winapi, SetLastError = true, CharSet = CharSet.Auto
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SystemTimeToFileTime([In] ref SYSTEMTIME lpSystemTime, [Out]out FILETIME lpFileTime);

VB Signature:

Declare Function SystemTimeToFileTime Lib "Coredll.dll" (TODO) As TODO

User-Defined Types:

Structure.SystemTime and Structure.FileTime

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

//Taken from http://www.codeproject.com/csharp/timezoneconversions.asp?print=true
private static DateTime SystemTimeToDateTime(ref SYSTEMTIME st)
{
        FILETIME ft = new FILETIME();
        SystemTimeToFileTime(ref st, out ft);
        DateTime dt = new DateTime((((long)ft.dwHighDateTime) << 32) | (uint)ft.dwLowDateTime);
        return dt;
}

Documentation