The data types DATE
, DATE_AND_TIME
(DT
), and TIME_OF_DAY
(TOD
) are handled internally like a DWORD
(32-bit value).
The data types LDATE
, LDATE_AND_TIME
(LDT
), and LTIME_OF_DAY
(LTOD
) are treated internally like an LWORD
(64-bit value).
The values of these data types are measured in seconds, milliseconds, and nanoseconds since 01/01/1970.
Data Type |
Lower Limit |
Upper Limit |
Memory |
Resolution |
---|---|---|---|---|
|
|
|
32-bit |
Seconds (although only the day is displayed) |
|
|
|
32-bit |
Seconds |
|
|
|
32-bit |
Milliseconds |
|
|
|
64 bits |
Nanoseconds (although only the day is displayed) |
|
|
|
64 bits |
Nanoseconds |
|
|
|
64 bits |
Nanoseconds |
VAR //Date dateBottom : DATE := DATE#1970-1-1; dateTop : DATE := DATE#2106-2-7; dateAppointment : DATE := D#2020-2-7; // D 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 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_VAR