FILETIME_TO_SYSTEMTIME

FILETIME_TO_SYSTEMTIME 1:

The function "FILETIME_TO_SYSTEMTIME" converts the time in FILETIME format into the "readable" SYSTEMTIME format. The conversion fails if the most significant bit of the 64-bit FILETIME variables is set. In this case the TIMESTRUCT member variables have the value zero.

FUNCTION FILETIME_TO_SYSTEMTIME: TIMESTRUCT

VAR_INPUT

VAR_INPUT
    fileTime : T_FILETIME;
END_VAR

fileTime: The time to be converted in FILETIME format (type: T_FILETIME).

Example:

PROGRAM MAIN
VAR
    fbSystemTime     : GETSYSTEMTIME;
    timeAsFileTime   : T_FILETIME;
    timeAsSystemTime : TIMESTRUCT;
END_VAR
fbSystemTime( timeLoDW=>timeAsFileTime.dwLowDateTime, timeHiDW=>timeAsFileTime.dwHighDateTime );
timeAsSystemTime := FILETIME_TO_SYSTEMTIME( timeAsFileTime );

Requirements

Development environment

Target platform

PLC libraries to be integrated (category group)

TwinCAT v3.1.0

PC or CX (x86, x64, ARM)

Tc2_Utilities (System)