DecodeDateTime

DecodeDateTime 1:

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

DecodeDateTime 2: Return value

Name

Type

DecodeDateTime

BOOL

DecodeDateTime 3:/DecodeDateTime 4: Inputs/Outputs

Name

Type

sDT

STRING

DecodeDateTime 5: Outputs

Name

Type

nDT

DATE_AND_TIME

hrErrorCode

HRESULT

Sample call:

bSuccess := fbJson.DecodeDateTime('2017-08-09T06:54:00', nDT => dateTime);