DecodeDateTime

This method enables the generation of a PLC variable of the type DATE_AND_TIME or DT from a standardized ISO8601 time format (e.g. YYYY-MM-DDThh:mm:ss). DT corresponds to the number of seconds starting from the date 01.01.1970. If the conversion was successful the method returns TRUE, otherwise it returns FALSE.
Syntax
METHOD DecodeDateTime : BOOL
VAR_IN_OUT CONSTANT
sDT : STRING;
END_VAR
VAR_OUTPUT
nDT : DATE_AND_TIME;
hrErrorCode : HRESULT;
END_VAR
Return value
Name | Type |
---|---|
DecodeDateTime | BOOL |
/
Inputs/Outputs
Name | Type |
---|---|
sDT | STRING |
Outputs
Name | Type |
---|---|
nDT | DATE_AND_TIME |
hrErrorCode | HRESULT |
Sample call:
bSuccess := fbJson.DecodeDateTime('2017-08-09T06:54:00', nDT => dateTime);