Click to Rate and Give Feedback
MSDN
MSDN Library
System Services
Time
Time Reference
Time Functions
 FileTimeToSystemTime Function

  Switch on low bandwidth view
FileTimeToSystemTime Function

Converts a file time to system time format.

Syntax

C++
BOOL WINAPI FileTimeToSystemTime(
  __in   const FILETIME *lpFileTime,
  __out  LPSYSTEMTIME lpSystemTime
);

Parameters

lpFileTime [in]

A pointer to a FILETIME structure containing the file time to convert to system date and time format.

This value must be less than 0x8000000000000000. Otherwise, the function fails.

lpSystemTime [out]

A pointer to a SYSTEMTIME structure to receive the converted file time.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Examples

For an example, see Retrieving the Last-Write Time.

Requirements

Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll

See Also

DosDateTimeToFileTime
File Times
FILETIME
FileTimeToDosDateTime
SYSTEMTIME
SystemTimeToFileTime
Time Functions

Send comments about this topic to Microsoft

Build date: 5/14/2009

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
vb.net syntax      dmex   |   Edit   |   Show History
<DllImport("Kernel32.dll", SetLastError:=True)> _
Public Shared Function FileTimeToSystemTime(ByRef FileTime As FILETIME, ByRef SystemTime As SYSTEMTIME) As Long
End Function
Flag as ContentBug
C# syntax      dmex   |   Edit   |   Show History
[DllImport("Kernel32.dll", SetLastError=true)]
private static extern long FileTimeToSystemTime(ref FILETIME FileTime, ref SYSTEMTIME SystemTime);
Tags What's this?: c# (x) syntax (x) Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker