2 Instruction Descriptions
2-600
NJ-series Instructions Reference Manual (W502)
The following example is for the following values for the members of In: Ye a r is UINT#1970, Month is
USINT#1, Day is USINT#2, Hour is USINT#12, Min is USINT#34, Sec is USINT#56, and Nsec is
ULINT#999999999.
Use the DtToDateStruct instruction (page 2-597) to break down a date and time into a year, month, day,
hour, minutes, seconds, and nanoseconds.
An error occurs in the following cases. ENO will be FALSE, and Out will not change.
• The value of a member of In is outside of the valid range.
• The processing result exceeds the valid range of Out.
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.
Additional Information
Precautions for Correct Use
def:=DateStructToDt(abc);
LD ST
defabc
DateStructToDt
EN ENO
In
In=abc
Out=def
Joined
Month
Day
Hour
Minutes
Seconds
Nanoseconds
Ye a r
DT#1970-1-2-12:34:56.999999999
.Year
.Month
.Day
.Hour
.Min
.Sec
.Nsec
UINT#1970
USINT#1
USINT#2
USINT#12
USINT#34
USINT#56
ULINT#999999999