4 out of 8 rated this helpful - Rate this topic

SystemTimeToFileTime function

Applies to: desktop apps | Metro style apps

Converts a system time to file time format. System time is based on Coordinated Universal Time (UTC).

Syntax

BOOL WINAPI SystemTimeToFileTime(
  __in   const SYSTEMTIME *lpSystemTime,
  __out  LPFILETIME lpFileTime
);

Parameters

lpSystemTime [in]

A pointer to a SYSTEMTIME structure that contains the system time to be converted from UTC to file time format.

The wDayOfWeek member of the SYSTEMTIME structure is ignored.

lpFileTime [out]

A pointer to a FILETIME structure to receive the converted system 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 Changing a File Time to the Current Time.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winbase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

DosDateTimeToFileTime
FILETIME
FileTimeToDosDateTime
FileTimeToSystemTime
System Time
SYSTEMTIME
Time Functions

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Role of SYSTEMTIME::wDayOfWeek.
Is SYSTEMTIME::wDayOfWeek used for the conversion to FILETIME or can be left uninitialized? Well from my Test: the Anser is: No it is not used in the conversion and it can be left uninitialized.
When / what situations and how I can use this API??
Hi all,
I got the basic idea regarding this API.In my code someone has used that also.But i did not get at what sitations/conditions i will make use of this API. What file time actcully mean??
Regards,
Jyotiranjan.
Please move questions to Forums "In what case...?"
This isn't the best place for questions. The forums at http://forums.msdn.com are designed for questions and answers. If you receive a good answer, feel free to post it back here so others may benefit.