CONCAT_DATE_TOD

Combines a date and a time-of-day into a date-and-time value.

Signature

     ┌───────────────┐
IN1 ─┤               │
     │CONCAT_DATE_TOD├─ OUT
IN2 ─┤               │
     └───────────────┘
FUNCTION CONCAT_DATE_TOD : DATE_AND_TIME
  VAR_INPUT
    IN1 : DATE;
    IN2 : TIME_OF_DAY;
  END_VAR
END_FUNCTION

The return type is DATE_AND_TIME. IN1 is DATE and IN2 is TIME_OF_DAY.

Inputs

Name

Type

Description

IN1

DATE

The date component.

IN2

TIME_OF_DAY

The time-of-day component.

Outputs

Name

Type

Description

Return value

DATE_AND_TIME

The combined date and time-of-day.

Description

Combines the date portion from IN1 with the time-of-day portion from IN2 to produce a DATE_AND_TIME value. The time-of-day value is converted from milliseconds to seconds before being added to the date.

Note

Sub-second precision from the TIME_OF_DAY input is lost because DATE_AND_TIME is stored in whole seconds.

Example

result := CONCAT_DATE_TOD(D#2000-01-01, TOD#12:00:00);

See Also

References