DecodeDcTime

DecodeDcTime 1:

This method enables the generation of a PLC variable of the type DCTIME from a standardized ISO8601 time format (e.g. YYYY-MM-DDThh:mm:ss). DCTIME corresponds to the number of nanoseconds starting from the date 01.01.2000. If the conversion was successful the method returns TRUE, otherwise it returns FALSE.

Syntax

METHOD DecodeDcTime : BOOL
VAR_IN_OUT CONSTANT
  sDC         : STRING;
END_VAR
VAR_OUTPUT
  nDC         : DCTIME;
  hrErrorCode : HRESULT;
END_VAR

DecodeDcTime 2: Return value

Name

Type

DecodeDcTime

BOOL

DecodeDcTime 3:/DecodeDcTime 4: Inputs/Outputs

Name

Type

sDC

STRING

DecodeDcTime 5: Outputs

Name

Type

nDC

DCTIME

hrErrorCode

HRESULT

Sample call:

bSuccess := fbJson.DecodeDcTime('2017-08-09T06:54:00', nDc => dcTime);