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 |
|---|---|---|
|
|
The date component. |
|
|
The time-of-day component. |
Outputs
Name |
Type |
Description |
|---|---|---|
Return value |
|
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¶
ADD_DT_TIME — add duration to datetime
SUB_DT_DT — difference between two datetimes
References¶
IEC 61131-3 §2.5.1.5.8