2 Instruction Descriptions
2-578
NJ-series Instructions Reference Manual (W502)
SecToDt
The SecToDt instruction converts the number of seconds from 00:00:00 on January 1, 1970 to a date
and time.
The SecToDt instruction converts the number of seconds from 00:00:00 on January 1, 1970 in In to a
date and time.
The following example is for when In is LINT#86400.
[
Instruction Name FB/FUN Graphic expression ST expression
SecToDt Convert Seconds to
Date and Time
FUN Out:=SecToDt(In);
Variables
Name Meaning I/O Description Valid range Unit Default
In Seconds Input Number of seconds from
00:00:00 on January 1, 1970
0 to 18446744073 Seconds 0
Out Date and
time
Output Date and time Depends on data type. Year, month,
day, hour,
minutes, sec-
onds
---
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
(@)SecToDt
EN ENO
In Out
abc:=SecToDt(LINT#86400);
LINT#86400
LD ST
abc
SecToDt
EN ENO
In
+
DT#1970-1-1-0:0:0.000000000
LINT#86400
DT#1970-1-2-0:0:0.000000000
s
In
Out=abc