F_GetWeekOfTheYear

F_GetWeekOfTheYear 1:

The function returns the calendar week number for a specified date according to the DIN 1355 / ISO 8601 standard.

FUNCTION F_GetWeekOfTheYear : WORD

F_GetWeekOfTheYear 2: Inputs

VAR_INPUT
    in : DT;
END_VAR

Name

Type

Description

in

DT

The date whose calendar week is to be determined.

Example:

PROGRAM MAIN
VAR
    dtNow      : DT := DT#2008-03-17-12:00;
    weekOfYear : WORD;
END_VAR
weekOfYear := F_GetWeekOfTheYear(dtNow);

The result is 12.

Requirements

Development environment

Target platform

PLC libraries to be integrated (category group)

TwinCAT v3.1.0

PC or CX (x86, x64, ARM)

Tc2_Utilities (System)