2 Instruction Descriptions
2-598
NJ-series Instructions Reference Manual (W502)
The following example is for when In is DT#1970-1-2-12:34:56.999999999.
• Use the DateStructToDt instruction (page 2-599) to join a year, month, day, hour, minutes, seconds,
and nanoseconds into a date and time.
• The following example shows how to find the current time of day.
Return value Out is not used when the instruction is used in ST.
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
abc:=DtToDateStruct(DT#1970-1-2-12:34:56.999999999);
DT#1970-1-2-12:34:56.999999999
LD
ST
abc
DtToDateStruct
EN ENO
In
In
Broken down
Month
Day
Hour
Minutes
Seconds
Nanoseconds
Ye a r
DT#1970-1-2-12:34:56.999999999
UINT#1970
.Year
Out=abc
USINT#1
.Month
USINT#2
.Day
USINT#12
.Hour
USINT#34
.Min
USINT#56
.Sec
ULINT#999999999
.Nsec
DtToDateStruct(_CurrentTime, abc);
_CurrentTime
● LD
● ST
abc
DtToDateStruct
EN ENO
In
DateStruct