DT_TO_SYSTEMTIME
The "DT_TO_SYSTEMTIME" function allows a PLC variable in DATE_AND_TIME format (DT) to be converted to a Windows system time structure. The system time has a resolution of 1ms, while the resolution of DATE_AND_TIME is 1s. The "wMilliseconds" variable in the system time structure therefore always returns the value zero.
FUNCTION DT_TO_SYSTEMTIME: TIMESTRUCT
VAR_INPUT
VAR_INPUT
DTIN : DT;
END_VAR
DTIN: The date and time to be converted, in DATE_AND_TIME format.
Example:
PROGRAM SystemTimeTest
VAR
SystemTimeStruct : TIMESTRUCT;
END_VAR
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) |