Data type: DATE
The data types for data and time DATE, DATE_AND_TIME (DT), and TIME_OF_DAY (TOD) are handled internally as a DWORD (32-bit value).
The data types LDATE, LDATE_AND_TIME (LDT), and LTIME_OF_DAY (LTOD) are treated internally as an LWORD (64-bit value).
Data Type | Lower Limit | Default | Upper Limit | Memory | Resolution | Description |
|---|---|---|---|---|---|---|
|
|
| 32-bit | Seconds (although only the day is displayed) | Syntax: Syntax: | |
|
|
| 32-bit | Seconds | Syntax: Syntax: | |
|
|
| 32-bit | Milliseconds | Syntax: Syntax: | |
|
|
|
| 64 bit | Nanoseconds (although only the day is displayed) | Syntax: |
|
|
|
| 64 bit | Nanoseconds | Syntax: Syntax: |
|
|
| 64 bit | Nanoseconds | Syntax: Syntax: |
VAR
//Date
dateBottom : DATE := DATE#1970-1-1;
dateTop : DATE := DATE#2106-2-7;
dateAppointment : DATE := D#2020-2-7; // D as data type prohibited
//Date and time
dtBottom : DATE_AND_TIME := DATE_AND_TIME#1970-1-1-0:0:0;
dtTop : DT := DATE_AND_TIME#2106-02-07-06:28:15;
dtAppointment : DT := DT#2020-2-7-12:55:1.234;
//Time of day
todBottom : TIME_OF_DAY := TIME_OF_DAY#0:0:0;
todTop : TOD := TIME_OF_DAY#23:59:59.999;
todAppointment : TOD := TOD#12:3:4.567;
// Long date
ldateBottom : LDATE := LDATE#1970-1-1;
ldateTop : LDATE := LDATE#2106-2-7;
ldateAppointment : LDATE := LD#2020-2-7; // LD as data typ prohibited
// Long date and time
ldtBottom : LDATE_AND_TIME := LDATE_AND_TIME#1970-1-1-0:0:0;
ldtTop : LDT := LDATE_AND_TIME#2262-4-10-23:34:33.709551615;
ldtAppointment : LDT := LDT#2020-2-7-12:55:1.234567891;
//Long time of day
ltodBottom : LTIME_OF_DAY := LTIME_OF_DAY#0:0:0;
ltodTop : LTOD := LTIME_OF_DAY#23:59:59.999999999 ;
ltodAppointment : LTOD := LTOD#12:3:4.567890123;
END_VARFor more information, see: Constants: Date and Time , DATE, DT, TOD, LDATE, LDT, LTOD