Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

SystemTimeToFileTime (coredll)
 

coredll is for smart devices, not desktop Windows. Therefore, this information only applies to code using the .NET Compact Framework. To see if information for SystemTimeToFileTime in other DLLs exists, click on Find References to the right.

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

C# Signature:

[DllImport("kernel32.dll", EntryPoint = "SystemTimeToFileTime", SetLastError = true)]
    public static extern bool SystemTimeToFileTime(ref SYSTEMTIME lpSystemTime, ref FILETIME lpFileTime);
[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:

SystemTime and FileTime

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

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions