DTCurDateTime

 Function BlockClosed A function block groups an algorithm and a set of private data. It has inputs and outputs. - Get the present date and time stamp.

Inputs

Input

Data Type

Range Unit Default

Description

Local

BOOL

TRUE, FALSE

N/A

No default

  • TRUE if local time is requested.
  • FALSE if GMT is requested.

Outputs

Output

Data Type

Range Unit

Description

Year

DINT

1900 to 2200

Years

Present year.

Month

DINT

1 to 12

Months

Present month.

Day

DINT

1 to 31

Days

Present day.

Hour

DINT

0 to 23

Hours

Present time: hours.

Min

DINT

0 to 59

Minutes

Present time: minutes.

Sec

DINT

0 to 60

Seconds

Present time: seconds.

MSec

DINT

0 to 999

Milliseconds

Present time: milliseconds.

TmOfDay

TIME

0 to 86,399,999

Milliseconds

Present time of day (milliseconds since midnight).

DST

BOOL

TRUE, FALSE

N/A

Indicates if the time is in:

  • Daylight saving time (DST = TRUE)
  • Standard time (DST = FALSE)

Remarks

None

FBD Language

FFLD Language

IL Language

Not available.

ST Language

Inst_DTCurDateTime(useLocalTime);
localYear    := Inst_DTCurDateTime.Year;
localMonth   := Inst_DTCurDateTime.Month;
localDay     := Inst_DTCurDateTime.Day;
localHour    := Inst_DTCurDateTime.Hour;
localMin     := Inst_DTCurDateTime.Min;
localSec     := Inst_DTCurDateTime.Sec;
localMSec    := Inst_DTCurDateTime.MSec;
localTmOfDay := Inst_DTCurDateTime.TmOfDay;
localDST     := Inst_DTCurDateTime.DST;