DAY_OF_WEEK - Get the day of week

Help Contents

Introduction

Returns the day of week of a DATE value.

Syntax

Informal Syntax:

DAY_OF_WEEK( In )

Formal Syntax:

DAY_OF_WEEK( In1:=expression )

Parameters

ParameterTypeDescription
InDATEThe calendar date.

Return Value

The function returns an INT value representing the day of week. 0 is returned for Sunday, 1 is returned for Monday, and so on.

Examples

ExampleReturn Value
DAY_OF_WEEK( D#2020-08-24 )INT#1
DAY_OF_WEEK( DT#2020-08-23-12:00:00 )INT#0

Standards Compliance

IEC 61131-3 Third Edition: Table 36.8.

Note: The function also returns the day of week of a DATE_AND_TIME value. The IEC 61131-3 Third Edition states the parameter should be a DATE value.

Further Information

Date and Time Functions

For other date and time functions.

Glossary

For the meaning of terms used in Fernhill SCADA.