SystemTimeToFileTime

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

Syntax

Copy
BOOL SystemTimeToFileTime(
    const SYSTEMTIME* lpSystemTime,
    LPFILETIME lpFileTime
);

Parameters

lpSystemTime

A pointer to a SYSTEMTIME structure that contains the system time to be converted.

The wDayOfWeek member of the SYSTEMTIME structure is ignored.

lpFileTime

A pointer to a FILETIME structure to receive the converted system time.

Return Value

If the function succeeds, it returns a non-zero value; if the function fails, it returns 0 (zero).

To get extended error information, call GetLastError.

Remarks

A return value of 0 (zero) indicates that the passed SYSTEMTIME structure represents an invalid date. Certain situations, such as the additional day added in a leap year, can result in application logic unexpectedly creating an invalid date.

Requirements

Minimum supported version Header Library

eRTOS 1.0 SDK

timezoneapi.h (include Windows.h) rtkrnl.lib