LDATE_AND_TIME¶
64-bit combined date and time of day value.
Note
This feature requires IEC 61131-3 Edition 3. Use
--dialect iec61131-3-ed3 to enable it. See
Enabling Dialects and Features for details.
Size |
64 bits (second resolution) |
Default |
|
Range |
|
IEC 61131-3 |
Section 2.3.1 (Edition 3) |
Support |
Supported (Edition 3) |
A date and time is stored as a count of seconds since 1970-01-01. LDT
counts them in 64 bits, so it reaches far past the 2106 ceiling a 32-bit
DATE_AND_TIME has; a literal outside LDT#1970-01-01-00:00:00 to
LDT#9999-12-31-23:59:59 is reported as
P2038.
An LDT accepts a DT# literal, which widens, but a DT does not accept
an LDT# one — that narrows, and is reported as
P4022.
Literals¶
LDT#2024-01-15-14:30:00
LDATE_AND_TIME#2024-12-31-23:59:59
Example¶
event := LDT#2024-06-15-10:30:00;
deadline := LDT#2024-06-15-12:00:00;
on_time := event < deadline; (* on_time = TRUE *)
See Also¶
DATE_AND_TIME — 32-bit date and time
LDATE — 64-bit calendar date (Edition 3)
LTIME_OF_DAY — 64-bit time of day (Edition 3)
LTIME — 64-bit duration (Edition 3)