Time/date and duration data types

From Axel Public Wiki
Revision as of 11:38, 27 May 2020 by Axelpwiki (talk | contribs)
Jump to navigation Jump to search

LogicLab fully supports the following IEC data types:

DATE

DATE is implemented as a 32-bit signed integer type (DINT), and its granularity is set to seconds. The default value is 1970-01-01. As a DINT, its maximum representable value is 2147483647, which corresponds to the maximum date of Tuesday 19 January 2038 (in Greenwich Mean Time).

An example of a DATE may be the following:

DATE#1980-01-05;

LDATE

LDATE is implemented as a 64-bit signed integer type (LINT), and its granularity is set to nanoseconds. The default value is 1970-01-01. As a LINT, its maximum representable value is 9223372036854775807, which corresponds to the maximum date of Friday 11 April 2262 (in Greenwich Mean Time).

An example of a LDATE may be the following:

LDATE#1980-01-05;

DATE_AND_TIME

DATE_AND_TIME is implemented as a 32-bit signed integer type (DINT), and its granularity is set to seconds. The default value is 1970-01-01-00:00:00. As a DINT, its maximum representable value is 2147483647, which corresponds to the maximum date of Tuesday 19 January 2038 03:14:07 (in Greenwich Mean Time).

An example of a DATE_AND_TIME may be the following:

DATE_AND_TIME#1980-01-05-00:05:10;
DT#1980-01-05-00:05:10;

LDATE_AND_TIME

LDATE_AND_TIME is implemented as a 64-bit signed integer type (LINT), and its granularity is set to nanoseconds. The default value is 1970-01-01-00:00:00. As a LINT, its maximum representable value is 9223372036854775807, which corresponds to the maximum date of Friday 11 April 2262 23:47:16.854 (in Greenwich Mean Time).

An example of a LDATE_AND_TIME may be the following:

LDATE_AND_TIME#1980-01-05-00:05:10.123456789;
LDT#2080-01-05-20:05:10.123_456_789;

TIME

TIME is implemented as a 32-bit signed integer type (DINT), and its granularity is set to milliseconds. The default value is zero. As a DINT, the range of values goes from -24d_20h_31m_23s_648ms to 24d_20h_31m_23s_647ms.

An example of a TIME may be the following:

TIME#20d5h4m7s20ms;

LTIME

LTIME is implemented as a 64-bit signed integer type (LINT), and its granularity is set to nanoseconds. The default value is zero. As a LINT, the range of values goes from -106751d_23h_47m_16s_854ms_775us_808ns to 106751d_23h_47m_16s_854ms_775us_807ns.

An example of a LTIME may be the following:

LTIME#105d5h4m7s20ms50us30ns;

TIME_OF_DAY

TIME_OF_DAY is implemented as a 32-bit signed integer type (DINT), and its granularity is set to milliseconds. The default value is midnight. The maximum value is 23:59:59.999 and every operation that exceeds this value will be set to midnight. All the time units till the seconds are mandatory, whereas milliseconds may be specified or not.

An example of a TIME_OF_DAY may be the following:

TOD#13:40:55.123;

LTIME_OF_DAY

LTIME_OF_DAY is implemented as a 64-bit signed integer type (LINT), and its granularity is set to nanoseconds. The default value is midnight. The maximum value is 23:59:59.999999999 and every operation that exceeds this value will be set to midnight. All the time units till the seconds are mandatory, whereas milliseconds, microseconds and nanoseconds may be specified or not.

An example of a LTIME_OF_DAY may be the following:

LTOD#13:40:55.123456789;