You are here: Core Reference > Coding > Logic > MAKE_DATE_AND_TIME

MAKE_DATE_AND_TIME

Function Name

MAKE_DATE_AND_TIME

Description

Provides a date and time output that is made up from the components supplied via the inputs.

Arguments

Y {INT}

Y provides the year.

MO {SINT}

MO provides the month.

D {SINT}

D provides the day.

H {SINT}

H provides the hour.

MI {SINT}

MI provides the minutes.

S {SINT}

S provides the seconds.

MS {INT}

MS provides the milliseconds.

For more information on the data types for the inputs and outputs, see Data Type Hierarchy.

Returns

Output {DATE_AND_TIME}

Example:

Function Block Diagram - MAKE_DATE_AND_TIME:

The MAKE_DATE_AND_TIME outputs a date time value that is made up from the components supplied via its inputs (the year is taken from the Y input, month from the MO input and so on). On a live system, the inputs for a MAKE_DATE_AND_TIME function are often the results of a calculation, with the inputs being variable depending on the outputs of other functions etc.

ST Program - MAKE_DATE_AND_TIME:

The syntax for a MAKE_DATE_AND_TIME function in an ST Program is:

  • Output := MAKE_DATE_AND_TIME (Y, MO, D, H, MI, S, MS);

Where Output, Y, MO, D, H, MI, S, and MS are defined as variables earlier in the ST program.

Alternatively, you can use the following syntax:

  • Output := MAKE_TIME_AND_TIME (Y:= 2006, MO:= 02, D:= 14, H:= 12, MI:= 41, S:= 21, MS:= 17);

Where the numbers are the input values (in this case, they are the same numbers as used in the Function Block Diagram example).


ClearSCADA 2015 R2