Time Types
Overview
The primitive Date/Time types used in openEHR are represented by classes defined in the package base.foundation_types.time. These are concrete types based on the ISO 8601 (2004) date/time standard semantics, which supports partial dates, times, and complex durations, all of which are needed in the biomedical and clinical domains. These classes have a String physical representation. and are assumed to exist in close to the form specified here, because they are specified in other openEHR specifications.
The time package is shown below.
base.foundation_types.time packagePrimitive Time Types
The set of ISO 8601 based types define dates and times with a String representation (as per ISO 8601), and the ISO 8601 'partial' and 'extended' semantics. They are defined as descendents of the native types described above, and add the necessary elements required for ISO 8601.
class names of the form Iso8601_xxx have been used here to clearly identify these classes where used elsewhere in the openEHR specifications. In real implementations, other class names may be used as convenient, just as for the other primitive types.
|
For reasons of readability in data, it is strongly recommended that the 'extended' form of date and time strings be used when writing and displaying data, rather than the compact form. An extended date has the form yyyy-mm-dd rather than yyyymmdd, and an extended time has the form hh:mm:ss rather than hhmmss. Nevertheless, both forms should be supported so that openEHR-based systems that use 'straight-through' processing on legacy data that may be in the compact form remain conformant to the specifications.
|
ISO 8601 semantics not included in these types include:
-
'expanded' dates, which have year numbers of greater than 4 digits, and may be negative; in openEHR, only 4-digit year numbers are assumed;
-
the
YYYY-WW-DDmethod of expressing dates (since this is imprecise and difficult to compute with due to variable week starting dates, and not required in health); -
partial date/times with fractional minutes or hours, e.g.
hh,hhhormm,mm; in openEHR, only fractional seconds are supported; -
the interval syntax. Intervals of date/times are supported in openEHR, but their syntax form is defined by ADL, and is standardised across all comparable types, not just dates and times.
Deviations from the published standard include the following:
-
durations are supposed to take the form of
PnnWorPnnYnnMnnDTnnHnnMnnS, but in openEHR, the W (week) designator can be used in combination with the other designators, since it is very common to state durations of pregnancy as some combination of weeks and days. -
partial variants of
Iso8601_date_timecan include missing hours, days and months, whereas ISO 8601:2004 (section 4.3.3 c) only allows missing seconds and minutes. The reasons for this deviation are:-
the same deviation is used in HL7v2 and HL7v3 TS (timestamp) type, i.e. there are data in existing clinical systems matching this specification;
-
in a typed object model, this deviation is more sensible anyway; the ISO 8601 rule is most likely a limitation of the purely syntactic means of expression. In real systems where a timestamp/date-time is specified in a screen form, it makes sense to allow it to be as partial as possible, rather than artifically restricted to only missing seconds and minutes.
-
-
the time
24:00:00(or240000) is not allowed anywhere, whereas in ISO 8601:2004 it appears to be legal at least for pure times. This deviation is also appears to be used in HL7v2 and HL7v3 (where midnight is defined as the time00:00:00), and is preferable to the documented standard, since a date/time with time of24:00:00is really the next day, i.e. the date part is then incorrect.
See ISO 8601 and the official ISO 8601 standard for details. Note that in the date, time and date_time formats shown below, 'Z' and 'T' are literals. In the duration class shown below, 'P', 'Y', 'M', 'W', 'D', 'H', 'S' and 'T' are literals.
Derived Interval / Time Types
A number of useful types may be generated from the Date/time classes and the Interval classes. These are shown in blue on the following diagram.
Class Definitions
Time_Definitions Class
-
Definition
-
Effective
-
BMM
-
UML
Class |
Time_Definitions |
|||||
|---|---|---|---|---|---|---|
Description |
Definitions for date/time classes. Note that the timezone limits are set by where the international dateline is. Thus, time in New Zealand is quoted using |
|||||
Constants |
Signature |
Meaning |
||||
1..1 |
Seconds_in_minute: |
|||||
1..1 |
Minutes_in_hour: |
|||||
1..1 |
Hours_in_day: |
|||||
1..1 |
Nominal_days_in_month: |
Used for conversions of durations containing months to days and / or seconds. |
||||
1..1 |
Max_days_in_month: |
|||||
1..1 |
Days_in_year: |
|||||
1..1 |
Days_in_leap_year: |
|||||
1..1 |
Max_days_in_year: |
|||||
1..1 |
Nominal_days_in_year: |
Used for conversions of durations containing years to days and / or seconds. |
||||
1..1 |
Days_in_week: |
|||||
1..1 |
Months_in_year: |
|||||
1..1 |
Min_timezone_hour: |
Minimum hour value of a timezone (note that the -ve sign is supplied in the ISO8601_TIMEZONE class). |
||||
1..1 |
Max_timezone_hour: |
|||||
Functions |
Signature |
Meaning |
||||
1..1 |
||||||
1..1 |
valid_month ( |
|||||
1..1 |
valid_day ( |
True if d >= 1 and d <= days_in_month (m, y) |
||||
1..1 |
valid_hour ( |
True if (h >= 0 and h < Hours_in_day) or (h = Hours_in_day and m = 0 and s = 0) |
||||
1..1 |
valid_minute ( |
True if m >= 0 and m < Minutes_in_hour. |
||||
1..1 |
valid_second ( |
True if s >= 0 and s < Seconds_in_minute . |
||||
1..1 |
valid_fractional_second ( |
True if fs >= 0.0 and fs < 1.0 . |
||||
1..1 |
String is a valid ISO 8601 date, i.e. takes the complete form:
Where:
The combinations of |
|||||
1..1 |
String is a valid ISO 8601 date, i.e. takes the form:
with an additional optional timezone indicator of:
Where:
|
|||||
1..1 |
String is a valid ISO 8601 date-time, i.e. takes the form:
|
|||||
1..1 |
String is a valid ISO 8601 duration, i.e. takes the form:
Where each nn represents a number of years, months, etc. nnW represents a number of 7-day weeks. Note: allowing the Parameters
Where each
|
|||||
| Time_Definitions | |||||
|---|---|---|---|---|---|
Definitions for date/time classes. Note that the timezone limits are set by where the international dateline is. Thus, time in New Zealand is quoted using |
|||||
Constants |
|||||
Seconds_in_minute: |
|||||
Minutes_in_hour: |
|||||
Hours_in_day: |
|||||
Nominal_days_in_month: |
Used for conversions of durations containing months to days and / or seconds. |
||||
Max_days_in_month: |
|||||
Days_in_year: |
|||||
Days_in_leap_year: |
|||||
Max_days_in_year: |
|||||
Nominal_days_in_year: |
Used for conversions of durations containing years to days and / or seconds. |
||||
Days_in_week: |
|||||
Months_in_year: |
|||||
Min_timezone_hour: |
Minimum hour value of a timezone (note that the -ve sign is supplied in the ISO8601_TIMEZONE class). |
||||
Max_timezone_hour: |
|||||
Functions |
|||||
valid_year ( |
|||||
valid_month ( |
|||||
valid_day ( |
True if d >= 1 and d <= days_in_month (m, y) |
||||
valid_hour ( |
True if (h >= 0 and h < Hours_in_day) or (h = Hours_in_day and m = 0 and s = 0) |
||||
valid_minute ( |
True if m >= 0 and m < Minutes_in_hour. |
||||
valid_second ( |
True if s >= 0 and s < Seconds_in_minute . |
||||
valid_fractional_second ( |
True if fs >= 0.0 and fs < 1.0 . |
||||
String is a valid ISO 8601 date, i.e. takes the complete form:
Where:
The combinations of |
|||||
String is a valid ISO 8601 date, i.e. takes the form:
with an additional optional timezone indicator of:
Where:
|
|||||
String is a valid ISO 8601 date-time, i.e. takes the form:
|
|||||
String is a valid ISO 8601 duration, i.e. takes the form:
Where each nn represents a number of years, months, etc. nnW represents a number of 7-day weeks. Note: allowing the Parameters
Where each
|
|||||
{
"name": "Time_Definitions",
"documentation": "Definitions for date/time classes. Note that the timezone limits are set by where the international dateline is. Thus, time in New Zealand is quoted using `+12:00`, not `-12:00`.",
"constants": {
"Seconds_in_minute": {
"name": "Seconds_in_minute",
"type": "Integer",
"value": 60
},
"Minutes_in_hour": {
"name": "Minutes_in_hour",
"type": "Integer",
"value": 60
},
"Hours_in_day": {
"name": "Hours_in_day",
"type": "Integer",
"value": 24
},
"Nominal_days_in_month": {
"name": "Nominal_days_in_month",
"documentation": "Used for conversions of durations containing months to days and / or seconds.",
"type": "Real",
"value": 30.42
},
"Max_days_in_month": {
"name": "Max_days_in_month",
"type": "Integer",
"value": 31
},
"Days_in_year": {
"name": "Days_in_year",
"type": "Integer",
"value": 365
},
"Days_in_leap_year": {
"name": "Days_in_leap_year",
"type": "Integer",
"value": 366
},
"Max_days_in_year": {
"name": "Max_days_in_year",
"type": "Integer",
"value": "Days_in_leap_year"
},
"Nominal_days_in_year": {
"name": "Nominal_days_in_year",
"documentation": "Used for conversions of durations containing years to days and / or seconds.",
"type": "Real",
"value": 365.24
},
"Days_in_week": {
"name": "Days_in_week",
"type": "Integer",
"value": 7
},
"Months_in_year": {
"name": "Months_in_year",
"type": "Integer",
"value": 12
},
"Min_timezone_hour": {
"name": "Min_timezone_hour",
"documentation": "Minimum hour value of a timezone (note that the -ve sign is supplied in the ISO8601_TIMEZONE class).",
"type": "Integer",
"value": 12
},
"Max_timezone_hour": {
"name": "Max_timezone_hour",
"type": "Integer",
"value": 13
}
},
"functions": {
"valid_year": {
"name": "valid_year",
"parameters": {
"y": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "y",
"type": "Integer"
}
},
"post_conditions": {
"Post": "Result = y >= 0"
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"valid_month": {
"name": "valid_month",
"parameters": {
"m": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "m",
"type": "Integer"
}
},
"post_conditions": {
"Post": "Result = m >= 1 and m <= Months_in_year"
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"valid_day": {
"name": "valid_day",
"documentation": "True if d >= 1 and d <= days_in_month (m, y)",
"parameters": {
"y": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "y",
"type": "Integer"
},
"m": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "m",
"type": "Integer"
},
"d": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "d",
"type": "Integer"
}
},
"post_conditions": {
"Post": "Result = d >= 1 and d <= days_in_month (m, y)"
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"valid_hour": {
"name": "valid_hour",
"documentation": "True if (h >= 0 and h < Hours_in_day) or (h = Hours_in_day and m = 0 and s = 0)",
"parameters": {
"h": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "h",
"type": "Integer"
},
"m": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "m",
"type": "Integer"
},
"s": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "s",
"type": "Integer"
}
},
"post_conditions": {
"Post": "Result = (h >= 0 and h < Hours_in_day) or (h = Hours_in_day and m = 0 and s = 0)"
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"valid_minute": {
"name": "valid_minute",
"documentation": "True if m >= 0 and m < Minutes_in_hour.",
"parameters": {
"m": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "m",
"type": "Integer"
}
},
"post_conditions": {
"Post": "Result = m >= 0 and m < Minutes_in_hour"
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"valid_second": {
"name": "valid_second",
"documentation": "True if s >= 0 and s < Seconds_in_minute .",
"parameters": {
"s": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "s",
"type": "Integer"
}
},
"post_conditions": {
"Post": "Result = s >= 0 and s < Seconds_in_minute"
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"valid_fractional_second": {
"name": "valid_fractional_second",
"documentation": "True if fs >= 0.0 and fs < 1.0 .",
"parameters": {
"fs": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "fs",
"type": "Double"
}
},
"post_conditions": {
"Post": "Result = fs >= 0.0 and fs < 1.0 ."
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"valid_iso8601_date": {
"name": "valid_iso8601_date",
"documentation": "String is a valid ISO 8601 date, i.e. takes the complete form:\n\n* `YYYY-MM-DD` (extended, preferred) or one of the partial forms `YYYY-MM` or `YYYY`\n* `YYYYMMDD` (compact) or a partial variant `YYYYMM`.\n\nWhere:\n\n* `YYYY` is the string form of any positive number in the range `0000` - `9999` (zero-filled to four digits)\n* `MM` is `01` - `12` (zero-filled to two digits)\n* `DD` is `01` - `31` (zero-filled to two digits)\n\nThe combinations of `YYYY`, `MM`, `DD` numbers must be correct with respect to the Gregorian calendar.",
"parameters": {
"s": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "s",
"type": "String"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"valid_iso8601_time": {
"name": "valid_iso8601_time",
"documentation": "String is a valid ISO 8601 date, i.e. takes the form:\n\n* `hh:mm:ss[(,|.)s+][Z|±hh[:mm]]` (extended)\n* `hhmmss[(,|.)s+][Z|±hh[mm]]` (compact)\n* or one of the partial forms:\n** `hh:mm` (extended)\n** `hhmm` or `hh` (compact)\n\nwith an additional optional timezone indicator of:\n\n* `Z` or`±hh[:mm]` (extended) `±hh[mm]` (compact)\n\nWhere:\n\n* `hh` is \"00\" - \"23\" (0-filled to two digits)\n* `mm` is \"00\" - \"59\" (0-filled to two digits)\n* `ss` is \"00\" - \"60\" (0-filled to two digits)\n* `[(,|.)s+]` is an optional string consisting of a comma or decimal point followed by numeric string of 1 or more digits, representing a fractional second\n* `Z` is a literal meaning UTC (modern replacement for GMT), i.e. timezone `+0000`\n",
"parameters": {
"s": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "s",
"type": "String"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"valid_iso8601_date_time": {
"name": "valid_iso8601_date_time",
"documentation": "String is a valid ISO 8601 date-time, i.e. takes the form:\n\n* `YYYY-MM-DDThh:mm:ss[(,|.)s+][Z|±hh[:mm]]` (extended)\n* `YYYYMMDDThhmmss[(,|.)s+][Z|±hh[mm]]` (compact)\n* or one of the partial forms:\n** `YYYY-MM-DDThh:mm` or `YYYY-MM-DDThh` (extended)\n** `YYYYMMDDThhmm` or `YYYYMMDDThh` (compact)",
"parameters": {
"s": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "s",
"type": "String"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"valid_iso8601_duration": {
"name": "valid_iso8601_duration",
"documentation": "String is a valid ISO 8601 duration, i.e. takes the form:\n\n* `P[nnY][nnM][nnW][nnD][T[nnH][nnM][nnS]]`\n\nWhere each nn represents a number of years, months, etc. nnW represents a number of 7-day weeks.\n\nNote: allowing the `W` designator in the same expression as other designators is an exception to the published standard, but necessary in clinical information (typically for representing pregnancy duration).",
"parameters": {
"s": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "s",
"documentation": "String is a valid ISO 8601 duration, i.e. takes the form:\n\n* `P[nnY][nnM][nnW][nnD][T[nnH][nnM][nnS]]`\n\nWhere each `nn` represents a number of years, months, etc. `nnW` represents a number of 7- day weeks.\n\nNOTE: allowing the `W` designator in the same expression as other designators is an exception to the published standard, but necessary in clinical information (typically for representing pregnancy duration).",
"type": "String"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
}
}
}
Temporal Class
-
Definition
-
Effective
-
BMM
-
UML
Class |
Temporal (abstract) |
|
|---|---|---|
Description |
Abstract ancestor of time-related classes. |
|
Inherit |
||
| Temporal (abstract) | |||
|---|---|---|---|
Abstract ancestor of time-related classes. |
|||
Functions |
|||
Value equality. |
|||
Reference equality. Parameters
|
|||
Create new instance of a type. |
|||
Type name of an object as a string. May include generic parameters, as in "Interval<Time>". |
|||
Arithmetic comparison. In conjunction with ‘=’, enables the definition of the operators ‘>’, ‘>=’, ‘<=’, ‘<>’. In real type systems, this operator might be defined on another class for comparability. |
|||
{
"name": "Temporal",
"documentation": "Abstract ancestor of time-related classes.",
"is_abstract": true,
"ancestors": [
"Ordered"
]
}
Iso8601_type Class
-
Definition
-
Effective
-
BMM
-
UML
Class |
Iso8601_type (abstract) |
|
|---|---|---|
Description |
Abstract ancestor type of ISO 8601 types, defining interface for 'extended' and 'partial' concepts from ISO 8601. |
|
Inherit |
||
Attributes |
Signature |
Meaning |
1..1 |
value: |
Representation of all descendants is a single String. |
Functions |
Signature |
Meaning |
1..1 |
is_partial (): |
True if this date time is partial, i.e. if trailing end (right hand) value(s) is/are missing. |
1..1 |
is_extended (): |
True if this ISO8601 string is in the 'extended' form, i.e. uses ‘-’ and / or ‘:’ separators. This is the preferred format. |
| Iso8601_type (abstract) | |||||
|---|---|---|---|---|---|
Abstract ancestor type of ISO 8601 types, defining interface for 'extended' and 'partial' concepts from ISO 8601. |
|||||
Inherits: Any, Ordered, Temporal, Time_Definitions |
|||||
Constants |
|||||
Seconds_in_minute: |
+ Inherited from Time_Definitions |
||||
Minutes_in_hour: |
+ Inherited from Time_Definitions |
||||
Hours_in_day: |
+ Inherited from Time_Definitions |
||||
Nominal_days_in_month: |
Used for conversions of durations containing months to days and / or seconds. |
||||
Max_days_in_month: |
+ Inherited from Time_Definitions |
||||
Days_in_year: |
+ Inherited from Time_Definitions |
||||
Days_in_leap_year: |
+ Inherited from Time_Definitions |
||||
Max_days_in_year: |
+ Inherited from Time_Definitions |
||||
Nominal_days_in_year: |
Used for conversions of durations containing years to days and / or seconds. |
||||
Days_in_week: |
+ Inherited from Time_Definitions |
||||
Months_in_year: |
+ Inherited from Time_Definitions |
||||
Min_timezone_hour: |
Minimum hour value of a timezone (note that the -ve sign is supplied in the ISO8601_TIMEZONE class). |
||||
Max_timezone_hour: |
+ Inherited from Time_Definitions |
||||
Attributes |
|||||
value: |
Representation of all descendants is a single String. |
||||
Functions |
|||||
Value equality. |
|||||
Reference equality. Parameters
|
|||||
Create new instance of a type. |
|||||
Type name of an object as a string. May include generic parameters, as in "Interval<Time>". |
|||||
Arithmetic comparison. In conjunction with ‘=’, enables the definition of the operators ‘>’, ‘>=’, ‘<=’, ‘<>’. In real type systems, this operator might be defined on another class for comparability. |
|||||
valid_year ( |
+ Inherited from Time_Definitions |
||||
valid_month ( |
+ Inherited from Time_Definitions |
||||
valid_day ( |
True if d >= 1 and d <= days_in_month (m, y) |
||||
valid_hour ( |
True if (h >= 0 and h < Hours_in_day) or (h = Hours_in_day and m = 0 and s = 0) |
||||
valid_minute ( |
True if m >= 0 and m < Minutes_in_hour. |
||||
valid_second ( |
True if s >= 0 and s < Seconds_in_minute . |
||||
valid_fractional_second ( |
True if fs >= 0.0 and fs < 1.0 . |
||||
String is a valid ISO 8601 date, i.e. takes the complete form:
Where:
The combinations of |
|||||
String is a valid ISO 8601 date, i.e. takes the form:
with an additional optional timezone indicator of:
Where:
|
|||||
String is a valid ISO 8601 date-time, i.e. takes the form:
|
|||||
String is a valid ISO 8601 duration, i.e. takes the form:
Where each nn represents a number of years, months, etc. nnW represents a number of 7-day weeks. Note: allowing the Parameters
Where each
|
|||||
(abstract) is_partial (): |
True if this date time is partial, i.e. if trailing end (right hand) value(s) is/are missing. |
||||
(abstract) is_extended (): |
True if this ISO8601 string is in the 'extended' form, i.e. uses ‘-’ and / or ‘:’ separators. This is the preferred format. |
||||
{
"name": "Iso8601_type",
"documentation": "Abstract ancestor type of ISO 8601 types, defining interface for 'extended' and 'partial' concepts from ISO 8601.",
"is_abstract": true,
"ancestors": [
"Temporal",
"Time_Definitions"
],
"properties": {
"value": {
"_type": "P_BMM_SINGLE_PROPERTY",
"name": "value",
"documentation": "Representation of all descendants is a single String.",
"is_mandatory": true,
"type": "String"
}
},
"functions": {
"is_partial": {
"name": "is_partial",
"documentation": "True if this date time is partial, i.e. if trailing end (right hand) value(s) is/are missing.",
"is_abstract": true,
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"is_extended": {
"name": "is_extended",
"documentation": "True if this ISO8601 string is in the 'extended' form, i.e. uses ‘-’ and / or ‘:’ separators. This is the preferred format.",
"is_abstract": true,
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
}
}
}
Iso8601_date Class
-
Definition
-
Effective
-
BMM
-
UML
Class |
Iso8601_date |
|
|---|---|---|
Description |
Represents an ISO 8601 date, including partial and extended forms. Value may be:
See |
|
Inherit |
||
Functions |
Signature |
Meaning |
1..1 |
year (): |
Year. |
1..1 |
month (): |
Month in year. |
1..1 |
day (): |
Day in month. |
1..1 |
timezone (): |
Timezone; may be Void. |
1..1 |
month_unknown (): |
Indicates whether month in year is unknown. If so, the date is of the form |
1..1 |
day_unknown (): |
Indicates whether day in month is unknown. If so, and month is known, the date is of the form |
1..1 |
is_partial (): |
True if this date is partial, i.e. if days or more is missing. |
1..1 |
is_extended (): |
True if this date uses |
1..1 |
as_string (): |
Return string value in extended format. |
Invariants |
Year_valid: |
|
Month_valid: |
||
Day_valid: |
||
Partial_validity: |
||
| Iso8601_date | |||||
|---|---|---|---|---|---|
Represents an ISO 8601 date, including partial and extended forms. Value may be:
See |
|||||
Inherits: Any, Ordered, Temporal, Time_Definitions, Iso8601_type |
|||||
Constants |
|||||
Seconds_in_minute: |
+ Inherited from Time_Definitions |
||||
Minutes_in_hour: |
+ Inherited from Time_Definitions |
||||
Hours_in_day: |
+ Inherited from Time_Definitions |
||||
Nominal_days_in_month: |
Used for conversions of durations containing months to days and / or seconds. |
||||
Max_days_in_month: |
+ Inherited from Time_Definitions |
||||
Days_in_year: |
+ Inherited from Time_Definitions |
||||
Days_in_leap_year: |
+ Inherited from Time_Definitions |
||||
Max_days_in_year: |
+ Inherited from Time_Definitions |
||||
Nominal_days_in_year: |
Used for conversions of durations containing years to days and / or seconds. |
||||
Days_in_week: |
+ Inherited from Time_Definitions |
||||
Months_in_year: |
+ Inherited from Time_Definitions |
||||
Min_timezone_hour: |
Minimum hour value of a timezone (note that the -ve sign is supplied in the ISO8601_TIMEZONE class). |
||||
Max_timezone_hour: |
+ Inherited from Time_Definitions |
||||
Attributes |
|||||
value: |
Representation of all descendants is a single String. |
||||
Functions |
|||||
Value equality. |
|||||
Reference equality. Parameters
|
|||||
Create new instance of a type. |
|||||
Type name of an object as a string. May include generic parameters, as in "Interval<Time>". |
|||||
Arithmetic comparison. In conjunction with ‘=’, enables the definition of the operators ‘>’, ‘>=’, ‘<=’, ‘<>’. In real type systems, this operator might be defined on another class for comparability. |
|||||
valid_year ( |
+ Inherited from Time_Definitions |
||||
valid_month ( |
+ Inherited from Time_Definitions |
||||
valid_day ( |
True if d >= 1 and d <= days_in_month (m, y) |
||||
valid_hour ( |
True if (h >= 0 and h < Hours_in_day) or (h = Hours_in_day and m = 0 and s = 0) |
||||
valid_minute ( |
True if m >= 0 and m < Minutes_in_hour. |
||||
valid_second ( |
True if s >= 0 and s < Seconds_in_minute . |
||||
valid_fractional_second ( |
True if fs >= 0.0 and fs < 1.0 . |
||||
String is a valid ISO 8601 date, i.e. takes the complete form:
Where:
The combinations of |
|||||
String is a valid ISO 8601 date, i.e. takes the form:
with an additional optional timezone indicator of:
Where:
|
|||||
String is a valid ISO 8601 date-time, i.e. takes the form:
|
|||||
String is a valid ISO 8601 duration, i.e. takes the form:
Where each nn represents a number of years, months, etc. nnW represents a number of 7-day weeks. Note: allowing the Parameters
Where each
|
|||||
is_partial (): |
True if this date is partial, i.e. if days or more is missing. |
||||
is_extended (): |
True if this date uses |
||||
year (): |
Year. |
||||
month (): |
Month in year. |
||||
day (): |
Day in month. |
||||
timezone (): |
Timezone; may be Void. |
||||
month_unknown (): |
Indicates whether month in year is unknown. If so, the date is of the form |
||||
day_unknown (): |
Indicates whether day in month is unknown. If so, and month is known, the date is of the form |
||||
as_string (): |
Return string value in extended format. |
||||
Invariants |
|||||
Year_valid: |
|||||
Month_valid: |
|||||
Day_valid: |
|||||
Partial_validity: |
|||||
{
"name": "Iso8601_date",
"documentation": "Represents an ISO 8601 date, including partial and extended forms. Value may be:\n\n* `YYYY-MM-DD` (extended, preferred)\n* `YYYYMMDD` (compactd)\n* a partial invariant.\n\nSee `Time_definitions._valid_iso8601_date()_` for validity.",
"ancestors": [
"Iso8601_type"
],
"functions": {
"year": {
"name": "year",
"documentation": "Year.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"month": {
"name": "month",
"documentation": "Month in year.",
"pre_conditions": {
"Pre": "not month_unknown"
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"day": {
"name": "day",
"documentation": "Day in month.",
"pre_conditions": {
"Pre": "not day_unknown"
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"timezone": {
"name": "timezone",
"documentation": "Timezone; may be Void.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Iso8601_timezone"
}
},
"month_unknown": {
"name": "month_unknown",
"documentation": "Indicates whether month in year is unknown. If so, the date is of the form `\"YYYY\"`.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"day_unknown": {
"name": "day_unknown",
"documentation": "Indicates whether day in month is unknown. If so, and month is known, the date is of the form `\"YYYY-MM\"` or `\"YYYYMM\"`.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"is_partial": {
"name": "is_partial",
"documentation": "True if this date is partial, i.e. if days or more is missing.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"is_extended": {
"name": "is_extended",
"documentation": "True if this date uses `'-'` separators.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"as_string": {
"name": "as_string",
"documentation": "Return string value in extended format.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "String"
}
}
},
"invariants": {
"Year_valid": "valid_year (year)",
"Month_valid": "not month_unknown implies valid_month (month)",
"Day_valid": "not day_unknown implies valid_day (year, month, day)",
"Partial_validity": "month_unknown implies day_unknown"
}
}
Iso8601_time Class
-
Definition
-
Effective
-
BMM
-
UML
Class |
Iso8601_time |
|||
|---|---|---|---|---|
Description |
Represents an ISO 8601 time, including partial and extended forms. Value may be:
See
|
|||
Inherit |
||||
Functions |
Signature |
Meaning |
||
1..1 |
hour (): |
Hour in day, in 24-hour time. |
||
1..1 |
minute (): |
Minute in hour. |
||
1..1 |
second (): |
Second in minute. |
||
1..1 |
fractional_second (): |
Fractional seconds. |
||
1..1 |
timezone (): |
Timezone; may be Void. |
||
1..1 |
minute_unknown (): |
Indicates whether minute is unknown. If so, the time is of the form “hh”. |
||
1..1 |
second_unknown (): |
Indicates whether second is unknown. If so and month is known, the time is of the form |
||
1..1 |
is_decimal_sign_comma (): |
True if this time has a decimal part indicated by ‘,’ (comma) rather than ‘.’ (period). |
||
1..1 |
is_partial (): |
True if this time is partial, i.e. if seconds or more is missing. |
||
1..1 |
is_extended (): |
True if this time uses ‘-’, ‘:’ separators. |
||
1..1 |
has_fractional_second (): |
True if the fractional_second part is signficant (i.e. even if = 0.0). |
||
1..1 |
as_string (): |
Return string value in extended format. |
||
Invariants |
Hour_valid: |
|||
Minute_valid: |
||||
Second_valid: |
||||
Fractional_second_valid: |
||||
Partial_validity: |
||||
| Iso8601_time | |||||
|---|---|---|---|---|---|
Represents an ISO 8601 time, including partial and extended forms. Value may be:
See
|
|||||
Inherits: Any, Ordered, Temporal, Time_Definitions, Iso8601_type |
|||||
Constants |
|||||
Seconds_in_minute: |
+ Inherited from Time_Definitions |
||||
Minutes_in_hour: |
+ Inherited from Time_Definitions |
||||
Hours_in_day: |
+ Inherited from Time_Definitions |
||||
Nominal_days_in_month: |
Used for conversions of durations containing months to days and / or seconds. |
||||
Max_days_in_month: |
+ Inherited from Time_Definitions |
||||
Days_in_year: |
+ Inherited from Time_Definitions |
||||
Days_in_leap_year: |
+ Inherited from Time_Definitions |
||||
Max_days_in_year: |
+ Inherited from Time_Definitions |
||||
Nominal_days_in_year: |
Used for conversions of durations containing years to days and / or seconds. |
||||
Days_in_week: |
+ Inherited from Time_Definitions |
||||
Months_in_year: |
+ Inherited from Time_Definitions |
||||
Min_timezone_hour: |
Minimum hour value of a timezone (note that the -ve sign is supplied in the ISO8601_TIMEZONE class). |
||||
Max_timezone_hour: |
+ Inherited from Time_Definitions |
||||
Attributes |
|||||
value: |
Representation of all descendants is a single String. |
||||
Functions |
|||||
Value equality. |
|||||
Reference equality. Parameters
|
|||||
Create new instance of a type. |
|||||
Type name of an object as a string. May include generic parameters, as in "Interval<Time>". |
|||||
Arithmetic comparison. In conjunction with ‘=’, enables the definition of the operators ‘>’, ‘>=’, ‘<=’, ‘<>’. In real type systems, this operator might be defined on another class for comparability. |
|||||
valid_year ( |
+ Inherited from Time_Definitions |
||||
valid_month ( |
+ Inherited from Time_Definitions |
||||
valid_day ( |
True if d >= 1 and d <= days_in_month (m, y) |
||||
valid_hour ( |
True if (h >= 0 and h < Hours_in_day) or (h = Hours_in_day and m = 0 and s = 0) |
||||
valid_minute ( |
True if m >= 0 and m < Minutes_in_hour. |
||||
valid_second ( |
True if s >= 0 and s < Seconds_in_minute . |
||||
valid_fractional_second ( |
True if fs >= 0.0 and fs < 1.0 . |
||||
String is a valid ISO 8601 date, i.e. takes the complete form:
Where:
The combinations of |
|||||
String is a valid ISO 8601 date, i.e. takes the form:
with an additional optional timezone indicator of:
Where:
|
|||||
String is a valid ISO 8601 date-time, i.e. takes the form:
|
|||||
String is a valid ISO 8601 duration, i.e. takes the form:
Where each nn represents a number of years, months, etc. nnW represents a number of 7-day weeks. Note: allowing the Parameters
Where each
|
|||||
is_partial (): |
True if this time is partial, i.e. if seconds or more is missing. |
||||
is_extended (): |
True if this time uses ‘-’, ‘:’ separators. |
||||
hour (): |
Hour in day, in 24-hour time. |
||||
minute (): |
Minute in hour. |
||||
second (): |
Second in minute. |
||||
fractional_second (): |
Fractional seconds. |
||||
timezone (): |
Timezone; may be Void. |
||||
minute_unknown (): |
Indicates whether minute is unknown. If so, the time is of the form “hh”. |
||||
second_unknown (): |
Indicates whether second is unknown. If so and month is known, the time is of the form |
||||
is_decimal_sign_comma (): |
True if this time has a decimal part indicated by ‘,’ (comma) rather than ‘.’ (period). |
||||
has_fractional_second (): |
True if the fractional_second part is signficant (i.e. even if = 0.0). |
||||
as_string (): |
Return string value in extended format. |
||||
Invariants |
|||||
Hour_valid: |
|||||
Minute_valid: |
|||||
Second_valid: |
|||||
Fractional_second_valid: |
|||||
Partial_validity: |
|||||
{
"name": "Iso8601_time",
"documentation": "Represents an ISO 8601 time, including partial and extended forms. Value may be:\n\n* `hh:mm:ss[,sss][Z|±hh[mm]]` (extended, preferred) or\n* `hhmmss[,sss][Z|±hh[mm]]` (compact)\n* or a partial invariant.\n\nSee `_valid_iso8601_time()_` for validity.\n\nNOTE: A small deviation to the ISO 8601:2004 standard in this class is that the time `24:00:00` is not allowed, for consistency with `Iso8601_date_time`.",
"ancestors": [
"Iso8601_type"
],
"functions": {
"hour": {
"name": "hour",
"documentation": "Hour in day, in 24-hour time.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"minute": {
"name": "minute",
"documentation": "Minute in hour.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"second": {
"name": "second",
"documentation": "Second in minute.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"fractional_second": {
"name": "fractional_second",
"documentation": "Fractional seconds.",
"pre_conditions": {
"Pre": "not second_unknown"
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Real"
}
},
"timezone": {
"name": "timezone",
"documentation": "Timezone; may be Void.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Iso8601_timezone"
}
},
"minute_unknown": {
"name": "minute_unknown",
"documentation": "Indicates whether minute is unknown. If so, the time is of the form “hh”.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"second_unknown": {
"name": "second_unknown",
"documentation": "Indicates whether second is unknown. If so and month is known, the time is of the form `\"hh:mm\"` or `\"hhmm\"`.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"is_decimal_sign_comma": {
"name": "is_decimal_sign_comma",
"documentation": "True if this time has a decimal part indicated by ‘,’ (comma) rather than ‘.’ (period).",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"is_partial": {
"name": "is_partial",
"documentation": "True if this time is partial, i.e. if seconds or more is missing.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"is_extended": {
"name": "is_extended",
"documentation": "True if this time uses ‘-’, ‘:’ separators.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"has_fractional_second": {
"name": "has_fractional_second",
"documentation": "True if the fractional_second part is signficant (i.e. even if = 0.0).",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"as_string": {
"name": "as_string",
"documentation": "Return string value in extended format.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "String"
}
}
},
"invariants": {
"Hour_valid": "valid_hour(hour, minute, second)",
"Minute_valid": "not minute_unknown implies valid_minute (minute)",
"Second_valid": "not second_unknown implies valid_second (second)",
"Fractional_second_valid": "has_fractional_second implies (not second_unknown and valid_fractional_second (fractional_second))",
"Partial_validity": "minute_unknown implies second_unknown"
}
}
Iso8601_date_time Class
-
Definition
-
Effective
-
BMM
-
UML
Class |
Iso8601_date_time |
|
|---|---|---|
Description |
Represents an ISO 8601 date/time, including partial and extended forms. Value may be:
See Note that this class includes 2 deviations from ISO 8601:2004:
|
|
Inherit |
||
Functions |
Signature |
Meaning |
1..1 |
year (): |
Year. |
1..1 |
month (): |
Month in year. |
1..1 |
day (): |
Day in month. |
1..1 |
hour (): |
Hour in day. |
1..1 |
minute (): |
Minute in hour. |
1..1 |
second (): |
Second in minute. |
1..1 |
fractional_second (): |
Fractional seconds. |
1..1 |
timezone (): |
Timezone; may be Void. |
1..1 |
month_unknown (): |
Indicates whether month in year is unknown. |
1..1 |
day_unknown (): |
Indicates whether day in month is unknown. |
1..1 |
minute_unknown (): |
Indicates whether minute in hour is known. |
1..1 |
second_unknown (): |
Indicates whether minute in hour is known. |
1..1 |
is_decimal_sign_comma (): |
True if this time has a decimal part indicated by ‘,’ (comma) rather than ‘.’ (period). |
1..1 |
is_partial (): |
True if this date time is partial, i.e. if seconds or more is missing. |
1..1 |
is_extended (): |
True if this date/time uses ‘-’, ‘:’ separators. |
1..1 |
has_fractional_second (): |
True if the fractional_second part is signficant (i.e. even if = 0.0). |
1..1 |
as_string (): |
Return the string value in extended format. |
Invariants |
Year_valid: |
|
Month_valid: |
||
Day_valid: |
||
Hour_valid: |
||
Minute_valid: |
||
Second_valid: |
||
Fractional_second_valid: |
||
Partial_validity_year: |
||
Partial_validity_month: |
||
Partial_validity_day: |
||
Partial_validity_hour: |
||
Partial_validity_minute: |
||
| Iso8601_date_time | |||||
|---|---|---|---|---|---|
Represents an ISO 8601 date/time, including partial and extended forms. Value may be:
See Note that this class includes 2 deviations from ISO 8601:2004:
|
|||||
Inherits: Any, Ordered, Temporal, Time_Definitions, Iso8601_type |
|||||
Constants |
|||||
Seconds_in_minute: |
+ Inherited from Time_Definitions |
||||
Minutes_in_hour: |
+ Inherited from Time_Definitions |
||||
Hours_in_day: |
+ Inherited from Time_Definitions |
||||
Nominal_days_in_month: |
Used for conversions of durations containing months to days and / or seconds. |
||||
Max_days_in_month: |
+ Inherited from Time_Definitions |
||||
Days_in_year: |
+ Inherited from Time_Definitions |
||||
Days_in_leap_year: |
+ Inherited from Time_Definitions |
||||
Max_days_in_year: |
+ Inherited from Time_Definitions |
||||
Nominal_days_in_year: |
Used for conversions of durations containing years to days and / or seconds. |
||||
Days_in_week: |
+ Inherited from Time_Definitions |
||||
Months_in_year: |
+ Inherited from Time_Definitions |
||||
Min_timezone_hour: |
Minimum hour value of a timezone (note that the -ve sign is supplied in the ISO8601_TIMEZONE class). |
||||
Max_timezone_hour: |
+ Inherited from Time_Definitions |
||||
Attributes |
|||||
value: |
Representation of all descendants is a single String. |
||||
Functions |
|||||
Value equality. |
|||||
Reference equality. Parameters
|
|||||
Create new instance of a type. |
|||||
Type name of an object as a string. May include generic parameters, as in "Interval<Time>". |
|||||
Arithmetic comparison. In conjunction with ‘=’, enables the definition of the operators ‘>’, ‘>=’, ‘<=’, ‘<>’. In real type systems, this operator might be defined on another class for comparability. |
|||||
valid_year ( |
+ Inherited from Time_Definitions |
||||
valid_month ( |
+ Inherited from Time_Definitions |
||||
valid_day ( |
True if d >= 1 and d <= days_in_month (m, y) |
||||
valid_hour ( |
True if (h >= 0 and h < Hours_in_day) or (h = Hours_in_day and m = 0 and s = 0) |
||||
valid_minute ( |
True if m >= 0 and m < Minutes_in_hour. |
||||
valid_second ( |
True if s >= 0 and s < Seconds_in_minute . |
||||
valid_fractional_second ( |
True if fs >= 0.0 and fs < 1.0 . |
||||
String is a valid ISO 8601 date, i.e. takes the complete form:
Where:
The combinations of |
|||||
String is a valid ISO 8601 date, i.e. takes the form:
with an additional optional timezone indicator of:
Where:
|
|||||
String is a valid ISO 8601 date-time, i.e. takes the form:
|
|||||
String is a valid ISO 8601 duration, i.e. takes the form:
Where each nn represents a number of years, months, etc. nnW represents a number of 7-day weeks. Note: allowing the Parameters
Where each
|
|||||
is_partial (): |
True if this date time is partial, i.e. if seconds or more is missing. |
||||
is_extended (): |
True if this date/time uses ‘-’, ‘:’ separators. |
||||
year (): |
Year. |
||||
month (): |
Month in year. |
||||
day (): |
Day in month. |
||||
hour (): |
Hour in day. |
||||
minute (): |
Minute in hour. |
||||
second (): |
Second in minute. |
||||
fractional_second (): |
Fractional seconds. |
||||
timezone (): |
Timezone; may be Void. |
||||
month_unknown (): |
Indicates whether month in year is unknown. |
||||
day_unknown (): |
Indicates whether day in month is unknown. |
||||
minute_unknown (): |
Indicates whether minute in hour is known. |
||||
second_unknown (): |
Indicates whether minute in hour is known. |
||||
is_decimal_sign_comma (): |
True if this time has a decimal part indicated by ‘,’ (comma) rather than ‘.’ (period). |
||||
has_fractional_second (): |
True if the fractional_second part is signficant (i.e. even if = 0.0). |
||||
as_string (): |
Return the string value in extended format. |
||||
Invariants |
|||||
Year_valid: |
|||||
Month_valid: |
|||||
Day_valid: |
|||||
Hour_valid: |
|||||
Minute_valid: |
|||||
Second_valid: |
|||||
Fractional_second_valid: |
|||||
Partial_validity_year: |
|||||
Partial_validity_month: |
|||||
Partial_validity_day: |
|||||
Partial_validity_hour: |
|||||
Partial_validity_minute: |
|||||
{
"name": "Iso8601_date_time",
"documentation": "Represents an ISO 8601 date/time, including partial and extended forms. Value may be:\n\n* `YYYY-MM-DDThh:mm:ss[,sss][Z | ±hh[mm]]` (extended, preferred) or\n* `YYYYMMDDThhmmss[,sss][Z | ±hh[mm]]` (compact)\n* or a partial variant.\n\nSee `_valid_iso8601_date_time()_` for validity.\n\nNote that this class includes 2 deviations from ISO 8601:2004:\n\n* for partial date/times, any part of the date/time up to the month may be missing, not just seconds and minutes as in the standard;\n* the time `24:00:00` is not allowed, since it would mean the date was really on the next day.",
"ancestors": [
"Iso8601_type"
],
"functions": {
"year": {
"name": "year",
"documentation": "Year.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"month": {
"name": "month",
"documentation": "Month in year.",
"pre_conditions": {
"Pre": "not month_unknown"
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"day": {
"name": "day",
"documentation": "Day in month.",
"pre_conditions": {
"Pre": "not day_unknown"
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"hour": {
"name": "hour",
"documentation": "Hour in day.",
"pre_conditions": {
"Pre": "not hour_unknown"
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"minute": {
"name": "minute",
"documentation": "Minute in hour.",
"pre_conditions": {
"Pre": "not minute_unknown"
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"second": {
"name": "second",
"documentation": "Second in minute.",
"pre_conditions": {
"Pre": "not second_unknown"
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"fractional_second": {
"name": "fractional_second",
"documentation": "Fractional seconds.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Real"
}
},
"timezone": {
"name": "timezone",
"documentation": "Timezone; may be Void.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Iso8601_timezone"
}
},
"month_unknown": {
"name": "month_unknown",
"documentation": "Indicates whether month in year is unknown.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"day_unknown": {
"name": "day_unknown",
"documentation": "Indicates whether day in month is unknown.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"minute_unknown": {
"name": "minute_unknown",
"documentation": "Indicates whether minute in hour is known.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"second_unknown": {
"name": "second_unknown",
"documentation": "Indicates whether minute in hour is known.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"is_decimal_sign_comma": {
"name": "is_decimal_sign_comma",
"documentation": "True if this time has a decimal part indicated by ‘,’ (comma) rather than ‘.’ (period).",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"is_partial": {
"name": "is_partial",
"documentation": "True if this date time is partial, i.e. if seconds or more is missing.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"is_extended": {
"name": "is_extended",
"documentation": "True if this date/time uses ‘-’, ‘:’ separators.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"has_fractional_second": {
"name": "has_fractional_second",
"documentation": "True if the fractional_second part is signficant (i.e. even if = 0.0).",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"as_string": {
"name": "as_string",
"documentation": "Return the string value in extended format.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "String"
}
}
},
"invariants": {
"Year_valid": "valid_year (year)",
"Month_valid": "valid_month (month)",
"Day_valid": "valid_day(year, month, day)",
"Hour_valid": "valid_hour (hour, minute, second)",
"Minute_valid": "not minute_unknown implies valid_minute(minute)",
"Second_valid": "not second_unknown implies valid_second (second)",
"Fractional_second_valid": "has_fractional_second implies (not second_unknown and valid_fractional_second (fractional_second))",
"Partial_validity_year": "not month_unknown",
"Partial_validity_month": "not month_unknown",
"Partial_validity_day": "not day_unknown",
"Partial_validity_hour": "not hour_unknown",
"Partial_validity_minute": "minute_unknown implies second_unknown"
}
}
Iso8601_duration Class
-
Definition
-
Effective
-
BMM
-
UML
Class |
Iso8601_duration |
|
|---|---|---|
Description |
Represents an ISO 8601 duration, which may have multiple parts from years down to seconds. Value is in format:
|
|
Inherit |
||
Functions |
Signature |
Meaning |
1..1 |
seconds (): |
Number of seconds. |
1..1 |
fractional_seconds (): |
Fractional seconds. |
1..1 |
is_decimal_sign_comma (): |
True if this time has a decimal part indicated by ',' (comma) rather than '.' (period). |
1..1 |
is_partial (): |
Returns False. |
1..1 |
is_extended (): |
Returns True. |
1..1 |
months (): |
Number of months. |
1..1 |
years (): |
Number of years of nominal 365-day length. |
1..1 |
weeks (): |
Number of 7 day weeks. |
1..1 |
to_seconds (): |
Total number of seconds equivalent (including fractional) of entire duration. |
1..1 |
minutes (): |
Number of 60 second minutes. |
1..1 |
hours (): |
Number of 60 minute hours. |
1..1 |
days (): |
Number of 24 hour days. |
1..1 |
as_string (): |
Return the duration string value. |
Invariants |
Years_valid: |
|
Months_valid: |
||
Weeks_valid: |
||
Days_valid: |
||
Hours_valid: |
||
Minutes_valid: |
||
Seconds_valid: |
||
Fractional_second_valid: |
||
| Iso8601_duration | |||||
|---|---|---|---|---|---|
Represents an ISO 8601 duration, which may have multiple parts from years down to seconds. Value is in format:
|
|||||
Inherits: Any, Ordered, Temporal, Time_Definitions, Iso8601_type |
|||||
Constants |
|||||
Seconds_in_minute: |
+ Inherited from Time_Definitions |
||||
Minutes_in_hour: |
+ Inherited from Time_Definitions |
||||
Hours_in_day: |
+ Inherited from Time_Definitions |
||||
Nominal_days_in_month: |
Used for conversions of durations containing months to days and / or seconds. |
||||
Max_days_in_month: |
+ Inherited from Time_Definitions |
||||
Days_in_year: |
+ Inherited from Time_Definitions |
||||
Days_in_leap_year: |
+ Inherited from Time_Definitions |
||||
Max_days_in_year: |
+ Inherited from Time_Definitions |
||||
Nominal_days_in_year: |
Used for conversions of durations containing years to days and / or seconds. |
||||
Days_in_week: |
+ Inherited from Time_Definitions |
||||
Months_in_year: |
+ Inherited from Time_Definitions |
||||
Min_timezone_hour: |
Minimum hour value of a timezone (note that the -ve sign is supplied in the ISO8601_TIMEZONE class). |
||||
Max_timezone_hour: |
+ Inherited from Time_Definitions |
||||
Attributes |
|||||
value: |
Representation of all descendants is a single String. |
||||
Functions |
|||||
Value equality. |
|||||
Reference equality. Parameters
|
|||||
Create new instance of a type. |
|||||
Type name of an object as a string. May include generic parameters, as in "Interval<Time>". |
|||||
Arithmetic comparison. In conjunction with ‘=’, enables the definition of the operators ‘>’, ‘>=’, ‘<=’, ‘<>’. In real type systems, this operator might be defined on another class for comparability. |
|||||
valid_year ( |
+ Inherited from Time_Definitions |
||||
valid_month ( |
+ Inherited from Time_Definitions |
||||
valid_day ( |
True if d >= 1 and d <= days_in_month (m, y) |
||||
valid_hour ( |
True if (h >= 0 and h < Hours_in_day) or (h = Hours_in_day and m = 0 and s = 0) |
||||
valid_minute ( |
True if m >= 0 and m < Minutes_in_hour. |
||||
valid_second ( |
True if s >= 0 and s < Seconds_in_minute . |
||||
valid_fractional_second ( |
True if fs >= 0.0 and fs < 1.0 . |
||||
String is a valid ISO 8601 date, i.e. takes the complete form:
Where:
The combinations of |
|||||
String is a valid ISO 8601 date, i.e. takes the form:
with an additional optional timezone indicator of:
Where:
|
|||||
String is a valid ISO 8601 date-time, i.e. takes the form:
|
|||||
String is a valid ISO 8601 duration, i.e. takes the form:
Where each nn represents a number of years, months, etc. nnW represents a number of 7-day weeks. Note: allowing the Parameters
Where each
|
|||||
is_partial (): |
Returns False. |
||||
is_extended (): |
Returns True. |
||||
seconds (): |
Number of seconds. |
||||
fractional_seconds (): |
Fractional seconds. |
||||
is_decimal_sign_comma (): |
True if this time has a decimal part indicated by ',' (comma) rather than '.' (period). |
||||
months (): |
Number of months. |
||||
years (): |
Number of years of nominal 365-day length. |
||||
weeks (): |
Number of 7 day weeks. |
||||
to_seconds (): |
Total number of seconds equivalent (including fractional) of entire duration. |
||||
minutes (): |
Number of 60 second minutes. |
||||
hours (): |
Number of 60 minute hours. |
||||
days (): |
Number of 24 hour days. |
||||
as_string (): |
Return the duration string value. |
||||
Invariants |
|||||
Years_valid: |
|||||
Months_valid: |
|||||
Weeks_valid: |
|||||
Days_valid: |
|||||
Hours_valid: |
|||||
Minutes_valid: |
|||||
Seconds_valid: |
|||||
Fractional_second_valid: |
|||||
{
"name": "Iso8601_duration",
"documentation": "Represents an ISO 8601 duration, which may have multiple parts from years down to seconds. Value is in format:\n\n* `P[nnY][nnM][nnW][nnD][T[nnH][nnM][nnS]]`",
"ancestors": [
"Iso8601_type"
],
"functions": {
"seconds": {
"name": "seconds",
"documentation": "Number of seconds.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"fractional_seconds": {
"name": "fractional_seconds",
"documentation": "Fractional seconds.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Real"
}
},
"is_decimal_sign_comma": {
"name": "is_decimal_sign_comma",
"documentation": "True if this time has a decimal part indicated by ',' (comma) rather than '.' (period).",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"is_partial": {
"name": "is_partial",
"documentation": "Returns False.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"is_extended": {
"name": "is_extended",
"documentation": "Returns True.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"months": {
"name": "months",
"documentation": "Number of months.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"years": {
"name": "years",
"documentation": "Number of years of nominal 365-day length.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"weeks": {
"name": "weeks",
"documentation": "Number of 7 day weeks.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"to_seconds": {
"name": "to_seconds",
"documentation": "Total number of seconds equivalent (including fractional) of entire duration.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Real"
}
},
"minutes": {
"name": "minutes",
"documentation": "Number of 60 second minutes.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"hours": {
"name": "hours",
"documentation": "Number of 60 minute hours.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"days": {
"name": "days",
"documentation": "Number of 24 hour days.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"as_string": {
"name": "as_string",
"documentation": "Return the duration string value.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "String"
}
}
},
"invariants": {
"Years_valid": "years >= 0",
"Months_valid": "months >= 0",
"Weeks_valid": "weeks >= 0",
"Days_valid": "days >= 0",
"Hours_valid": "hours >= 0",
"Minutes_valid": "minutes >= 0",
"Seconds_valid": "seconds >= 0",
"Fractional_second_valid": "fractional_second >= 0.0 and fractional_second < 1.0"
}
}
Iso8601_timezone Class
-
Definition
-
Effective
-
BMM
-
UML
Class |
Iso8601_timezone |
|
|---|---|---|
Description |
ISO8601 timezone string, in format:
where:
|
|
Inherit |
||
Functions |
Signature |
Meaning |
1..1 |
hour (): |
Hour part of timezone - in the range 00 - 13. |
1..1 |
minute (): |
Minute part of timezone. Generally 00 or 30. |
1..1 |
sign (): |
Direction of timezone expresssed as +1 or -1. |
1..1 |
minute_unknown (): |
Indicates whether minute part known. |
1..1 |
is_partial (): |
True if this time zone is partial, i.e. if minutes is missing. |
1..1 |
is_extended (): |
True if this time-zone uses ‘:’ separators. |
1..1 |
is_gmt (): |
True if timezone is UTC, i.e. +0000. |
1..1 |
as_string (): |
Return timezone string. |
Invariants |
Min_hour_valid: |
|
Max_hour_valid: |
||
Minute_valid: |
||
Sign_valid: |
||
| Iso8601_timezone | |||||
|---|---|---|---|---|---|
ISO8601 timezone string, in format:
where:
|
|||||
Inherits: Any, Ordered, Temporal, Time_Definitions, Iso8601_type |
|||||
Constants |
|||||
Seconds_in_minute: |
+ Inherited from Time_Definitions |
||||
Minutes_in_hour: |
+ Inherited from Time_Definitions |
||||
Hours_in_day: |
+ Inherited from Time_Definitions |
||||
Nominal_days_in_month: |
Used for conversions of durations containing months to days and / or seconds. |
||||
Max_days_in_month: |
+ Inherited from Time_Definitions |
||||
Days_in_year: |
+ Inherited from Time_Definitions |
||||
Days_in_leap_year: |
+ Inherited from Time_Definitions |
||||
Max_days_in_year: |
+ Inherited from Time_Definitions |
||||
Nominal_days_in_year: |
Used for conversions of durations containing years to days and / or seconds. |
||||
Days_in_week: |
+ Inherited from Time_Definitions |
||||
Months_in_year: |
+ Inherited from Time_Definitions |
||||
Min_timezone_hour: |
Minimum hour value of a timezone (note that the -ve sign is supplied in the ISO8601_TIMEZONE class). |
||||
Max_timezone_hour: |
+ Inherited from Time_Definitions |
||||
Attributes |
|||||
value: |
Representation of all descendants is a single String. |
||||
Functions |
|||||
Value equality. |
|||||
Reference equality. Parameters
|
|||||
Create new instance of a type. |
|||||
Type name of an object as a string. May include generic parameters, as in "Interval<Time>". |
|||||
Arithmetic comparison. In conjunction with ‘=’, enables the definition of the operators ‘>’, ‘>=’, ‘<=’, ‘<>’. In real type systems, this operator might be defined on another class for comparability. |
|||||
valid_year ( |
+ Inherited from Time_Definitions |
||||
valid_month ( |
+ Inherited from Time_Definitions |
||||
valid_day ( |
True if d >= 1 and d <= days_in_month (m, y) |
||||
valid_hour ( |
True if (h >= 0 and h < Hours_in_day) or (h = Hours_in_day and m = 0 and s = 0) |
||||
valid_minute ( |
True if m >= 0 and m < Minutes_in_hour. |
||||
valid_second ( |
True if s >= 0 and s < Seconds_in_minute . |
||||
valid_fractional_second ( |
True if fs >= 0.0 and fs < 1.0 . |
||||
String is a valid ISO 8601 date, i.e. takes the complete form:
Where:
The combinations of |
|||||
String is a valid ISO 8601 date, i.e. takes the form:
with an additional optional timezone indicator of:
Where:
|
|||||
String is a valid ISO 8601 date-time, i.e. takes the form:
|
|||||
String is a valid ISO 8601 duration, i.e. takes the form:
Where each nn represents a number of years, months, etc. nnW represents a number of 7-day weeks. Note: allowing the Parameters
Where each
|
|||||
is_partial (): |
True if this time zone is partial, i.e. if minutes is missing. |
||||
is_extended (): |
True if this time-zone uses ‘:’ separators. |
||||
hour (): |
Hour part of timezone - in the range 00 - 13. |
||||
minute (): |
Minute part of timezone. Generally 00 or 30. |
||||
sign (): |
Direction of timezone expresssed as +1 or -1. |
||||
minute_unknown (): |
Indicates whether minute part known. |
||||
is_gmt (): |
True if timezone is UTC, i.e. +0000. |
||||
as_string (): |
Return timezone string. |
||||
Invariants |
|||||
Min_hour_valid: |
|||||
Max_hour_valid: |
|||||
Minute_valid: |
|||||
Sign_valid: |
|||||
{
"name": "Iso8601_timezone",
"documentation": "ISO8601 timezone string, in format:\n\n* `Z | ±hh[mm]`\n\nwhere:\n\n* `hh` is \"00\" - \"23\" (0-filled to two digits)\n* `mm` is \"00\" - \"59\" (0-filled to two digits)\n* `Z` is a literal meaning UTC (modern replacement for GMT), i.e. timezone `+0000`\n",
"ancestors": [
"Iso8601_type"
],
"functions": {
"hour": {
"name": "hour",
"documentation": "Hour part of timezone - in the range 00 - 13.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"minute": {
"name": "minute",
"documentation": "Minute part of timezone. Generally 00 or 30.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"sign": {
"name": "sign",
"documentation": "Direction of timezone expresssed as +1 or -1.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"minute_unknown": {
"name": "minute_unknown",
"documentation": "Indicates whether minute part known.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"is_partial": {
"name": "is_partial",
"documentation": "True if this time zone is partial, i.e. if minutes is missing.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"is_extended": {
"name": "is_extended",
"documentation": "True if this time-zone uses ‘:’ separators.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"is_gmt": {
"name": "is_gmt",
"documentation": "True if timezone is UTC, i.e. +0000.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"as_string": {
"name": "as_string",
"documentation": "Return timezone string.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "String"
}
}
},
"invariants": {
"Min_hour_valid": "sign = -1 implies hour > 0 and hour <= Min_timezone_hour",
"Max_hour_valid": "sign = 1 implies hour > 0 and hour <= Max_timezone_hour",
"Minute_valid": "not minute_unknown implies valid_minute (minute)",
"Sign_valid": "sign = 1 or sign = -1"
}
}