Date and Time of Day Literals

Help Contents

Introduction

Date and Time of Day Literals are used to indicate:

These types of literal are supported:

TypeDescription
DATEDefines a gregorian calendar date.
TIME_OF_DAYDefines a time of day.
DATE_AND_TIMECombines a DATE and TIME_OF_DAY to define a point in time.

The DATE, TIME_OF_DAY, and DATE_AND_TIME literals use these prefixes:

TypeShort FormLong Form
DATED#DATE#
TIME_OF_DAYTOD#TIME_OF_DAY#
DATE_AND_TIMEDT#DATE_AND_TIME#

Examples of DATE literals:

D#2012-04-14: 14th April 2012.

Date#2013-05-09: 9th May 2013.

Examples of TIME_OF_DAY literals:

TOD#13:29:20.500: 1:29 pm and 20.5 seconds.

Time_Of_Day#00:00:00: Midnight.

Examples of DATE_AND_TIME literals:

DT#2013-05-09-13:29:20.500: 1:29 pm and 20.5 seconds on 9th May 2013.

DATE_AND_TIME#2013-05-09-00:00:00: Midnight on 14th April 2012.

Standards Compliance

IEC 61131-3 Second Edition: Table 8 & Table 9.

IEC 61131-3 Third Edition: Table 9.

Further Information

Date and Time Functions

To learn about functions that operate on Date and Time values.

SysGetDateAndTime()

To learn about a function that returns the current date and time.

SysGetDate()

To learn about a function that returns the current date.

SysGetTimeOfDay()

To learn about a function that returns the current time of day.

Common Elements

To learn about other language Common Elements.

Glossary

For the meaning of terms used in Fernhill SCADA.