[DATI] Date and time of day functions

Function block DATI adds a time period to a point in time on a specific day and/or subtracts a time period from the point in time on a specific day.

DATI adds or subtracts a time period to/from a point in time on a specific day. A time period can be added while simultaneously subtracting a time period. The result is provided on output [Out], split into values for date, time, year, month, day, day of week, day of year, hour, minute, second, and millisecond.

Pins

Input

Description

Data type

Default value
Value range

In

Input

DateAndTime

01.01.1990
00:00:00.000

TiAdd

Time to add

Time

0 ms

TiSub

Time to subtract

Time

0 ms

 

Output

Description

Data type

Default value
Value range

Out

Output

DateAndTime

01.01.1990
00:00:00.000

Da

Date

Date

01.01.1990

TiDay

Time of day

TimeOfDay

00:00:00.000

Year

Year

Integer

1990

1990…2169

Month

Month

Integer

1: January

1…12

1: January
2: February
3: March
4: April
5: May
6: June
7: July
8: August
9: September
10: October
11: November
12: December

Day

Day

Integer

1

1…31

Hour

Hour

Integer

0

0…23

Minute

Minute

Integer

0

0…59

Second

Second

Integer

0

0…59

Mscnd

Millisecond

Integer

0

0…999

DayWeek

Day of week

Integer

1: Monday

1…7

1: Monday
2: Tuesday
3: Wednesday
4: Thursday
5: Friday
6: Saturday
7: Sunday

DayYear

Day of year

Integer

1

1…366