2 Instruction Descriptions
2-568
NJ-series Instructions Reference Manual (W502)
DT_TO_DATE
The DT_TO_DATE instruction extracts the date from a date and time.
The DT_TO_DATE instruction extracts the date from date and time In.
The following example is for when In is DT#1970-1-7-23:59:59.999999999.
Instruction Name FB/FUN Graphic expression ST expression
DT_TO_DATE Extract Date from
Date and Time
FUN Out:=DT_TO_DATE(In);
Variables
Name Meaning I/O Description Valid range Unit Default
In Date and
time
Input Date and time Depends on data type. Year, month,
day, hour,
minutes, sec-
onds
DT#197
0-1-1-
0:0:0
Out Date Output Date Depends on data type. Year, month,
day
---
Boolean
Bit strings Integers
Real
numbers
Times, durations,
dates, and text strings
BOOL
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
LREAL
TIME
DATE
TOD
DT
STRING
In OK
Out OK
Function
(@)DT_TO_DATE
EN ENO
In Out
abc:=DT_TO_DATE(DT#1970-1-7-23:59:59.999999999);
LD
ST
abc
DT#1970-1-7-23:59:59.999999999
DT_TO_DATE
EN ENO
In
DT#1970-1-7-23:59:59.999999999
D#1970-1-7
In
Out=abc