SYSTEMTIME_TO_STRING

SYSTEMTIME_TO_STRING 1:

The function converts the Windows system time structure into a string with the following format: YYYY-MM-DD-hh:mm:ss.xxx:

FUNCTION SYSTEMTIME_TO_STRING: STRING(24)

VAR_INPUT

VAR_INPUT
    in : TIMESTRUCT;
END_VAR

in: The structure with the Windows system time requiring conversion (type: TIMESTRUCT).

Example:

PROGRAM MAIN
VAR
    fbGetSystemTime  : GETSYSTEMTIME;
    fileTime         : T_FILETIME;
    sTime            : STRING;
END_VAR

fbGetSystemTime(timeLoDW=>fileTime.dwLowDateTime, timeHiDW=>fileTime.dwHighDateTime );
sTime := SYSTEMTIME_TO_STRING( FILETIME_TO_SYSTEMTIME( fileTime ) );

Online view:

SYSTEMTIME_TO_STRING 2:

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)