2-549
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Time and Time of Day Instructions
2
ADD_DT_TIME
The ADD_DT_TIME instruction adds a time, In2, to a date and time In1. The result of addition in Out is
also a date and time. Leap years are also accounted for. The following example is for when In1 is
DT#1970-1-1-0:0:0 and In2 is T#1d.
An error will not occur even if the addition result exceeds the valid range of Out.
• DT#2554-7-21-23:34:33.709551615 + T#0.000001ms → DT#1970-1-1-0:0:0
• DT#1970-1-1-0:0:0 + T#-0.000001ms → DT#2554-7-21-23:34:33.709551615
Function
Related System-defined Variables
Name Meaning Data type Description
_CurrentTime System Time of Day DT The time of day from the system clock. The num-
ber of seconds from 00:00:00 on January 1,1970.
Precautions for Correct Use
abc:=ADD_DT_TIME(DT#1970-1-1-0:0:0, T#1d);
LD
ST
abc
DT#1970-1-1-0:0:0
T#1d
ADD_DT_TIME
EN ENO
In1
In2
In1
In2
Out=abc
DT#1970-1-1-0:0:0
T#1d
DT#1970-1-2-0:0:0
+