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 (2019) 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-"W"WW-Dmethod 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. -
Durations in openEHR may take a negative sign, indicating a duration prior to an origin. This supports healthcare needs such as 'adjusted age' (e.g. '-P3M', an age of 'minus 3 months') for very premature newborns.
-
Partial variants of
Iso8601_date_timecan include missing hours, days and months, whereas ISO 8601:2019 (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 artificially restricted to only missing seconds and minutes.
-
-
The time
24:00:00(or240000) is not allowed anywhere, whereas in ISO 8601:2019 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.
Negation for ISO 8601 durations is also supported by W3C XML-schema and various programming languages. See Wikipedia 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.
Computational Functions
A number of computational functions are defined in the interfaces of the concrete data/time types, of two kinds:
-
definite: computed according to the usual numeric rules for arithmetic, in which all values are treated as definite, i.e. exact and invariant;
-
nominal: computed using commonly accepted rules of 'everyday' calendrical time, in which 'year' and 'month' are understood to be variable periods.
Most of the functions defined on the date/time types are of the definite kind. The exception is functions involving Iso8601_duration values, which take both definite and nominal forms. The definite forms are named using the standard names add(), subtract() etc, while the nominal versions have names of the form xxx_nominal(), e.g. add_nominal() etc.
An example of an operation having both forms is addition for the type Iso8601_date. The definite operation is called add() and treats the Iso8601_duration argument as an exact amount, based on constant values for length of year and month, defined by Time_definitions.Average_days_in_month and Time_definitions.Average_days_in_year.
The nominal form of the operation is add_nominal(), and is computed according to 'everyday' rules, i.e. in which the phrase 'a year from now' means the same date next year (with occasional slight adjustment), and 'in a month' means the same date next month (or possibly a day or earlier due to next month being shorter). In a similar way, the addition of a period of one day ('P1D'), although itself a regular quantity is computed differently to the definite form: in the definite form, addition of P1D results in the addition of exactly 24h of time to the date, which may result in a time that is different by one hour due to a change of summer time during the interval, while the nominal addition results in the same time on the next of previous day, even though occasionally this will represent 23 or 25 hours' difference.
The definite functions have standard operators such as '+', '-', etc. associated with them, while the nominal functions have the operators '++', '--', etc.
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: |
Number of seconds in a minute. |
||||
1..1 |
Minutes_in_hour: |
Number of minutes in an hour. |
||||
1..1 |
Hours_in_day: |
Number of clock hours in a day, i.e. 24. |
||||
1..1 |
Average_days_in_month: |
Used for conversions of durations containing months to days and / or seconds. |
||||
1..1 |
Max_days_in_month: |
Maximum number of days in any month. |
||||
1..1 |
Days_in_year: |
Calendar days in a normal year, i.e. 365. |
||||
1..1 |
Average_days_in_year: |
Used for conversions of durations containing years to days and / or seconds. |
||||
1..1 |
Days_in_leap_year: |
Calendar days in a standard leap year, i.e. 366. |
||||
1..1 |
Max_days_in_year: |
Maximum number of days in a year, i.e. accounting for leap years. |
||||
1..1 |
Days_in_week: |
Number of days in a week. |
||||
1..1 |
Months_in_year: |
Number of months in a year. |
||||
1..1 |
Min_timezone_hour: |
Minimum hour value of a timezone according to ISO 8601 (note that the -ve sign is supplied in the |
||||
1..1 |
Max_timezone_hour: |
Maximum hour value of a timezone according to ISO 8601. |
||||
1..1 |
Nominal_days_in_month: |
Used for conversions of durations containing months to days and / or seconds. |
||||
1..1 |
Nominal_days_in_year: |
Used for conversions of durations containing years to days and / or seconds. |
||||
Functions |
Signature |
Meaning |
||||
1..1 |
True if |
|||||
1..1 |
valid_month ( |
True if |
||||
1..1 |
valid_day ( |
True if |
||||
1..1 |
valid_hour ( |
True if |
||||
1..1 |
valid_minute ( |
True if |
||||
1..1 |
valid_second ( |
True if |
||||
1..1 |
valid_fractional_second ( |
True if |
||||
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. 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: |
Number of seconds in a minute. |
||||
Minutes_in_hour: |
Number of minutes in an hour. |
||||
Hours_in_day: |
Number of clock hours in a day, i.e. 24. |
||||
Average_days_in_month: |
Used for conversions of durations containing months to days and / or seconds. |
||||
Max_days_in_month: |
Maximum number of days in any month. |
||||
Days_in_year: |
Calendar days in a normal year, i.e. 365. |
||||
Average_days_in_year: |
Used for conversions of durations containing years to days and / or seconds. |
||||
Days_in_leap_year: |
Calendar days in a standard leap year, i.e. 366. |
||||
Max_days_in_year: |
Maximum number of days in a year, i.e. accounting for leap years. |
||||
Days_in_week: |
Number of days in a week. |
||||
Months_in_year: |
Number of months in a year. |
||||
Min_timezone_hour: |
Minimum hour value of a timezone according to ISO 8601 (note that the -ve sign is supplied in the |
||||
Max_timezone_hour: |
Maximum hour value of a timezone according to ISO 8601. |
||||
Nominal_days_in_month: |
Used for conversions of durations containing months to days and / or seconds. |
||||
Nominal_days_in_year: |
Used for conversions of durations containing years to days and / or seconds. |
||||
Functions |
|||||
valid_year ( |
True if |
||||
valid_month ( |
True if |
||||
valid_day ( |
True if |
||||
valid_hour ( |
True if |
||||
valid_minute ( |
True if |
||||
valid_second ( |
True if |
||||
valid_fractional_second ( |
True if |
||||
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. 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",
"documentation": "Number of seconds in a minute.",
"type": "Integer",
"value": 60
},
"Minutes_in_hour": {
"name": "Minutes_in_hour",
"documentation": "Number of minutes in an hour.",
"type": "Integer",
"value": 60
},
"Hours_in_day": {
"name": "Hours_in_day",
"documentation": "Number of clock hours in a day, i.e. 24.",
"type": "Integer",
"value": 24
},
"Average_days_in_month": {
"name": "Average_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",
"documentation": "Maximum number of days in any month.",
"type": "Integer",
"value": 31
},
"Days_in_year": {
"name": "Days_in_year",
"documentation": "Calendar days in a normal year, i.e. 365.",
"type": "Integer",
"value": 365
},
"Average_days_in_year": {
"name": "Average_days_in_year",
"documentation": "Used for conversions of durations containing years to days and / or seconds.",
"type": "Real",
"value": 365.24
},
"Days_in_leap_year": {
"name": "Days_in_leap_year",
"documentation": "Calendar days in a standard leap year, i.e. 366.",
"type": "Integer",
"value": 366
},
"Max_days_in_year": {
"name": "Max_days_in_year",
"documentation": "Maximum number of days in a year, i.e. accounting for leap years.",
"type": "Integer",
"value": "Days_in_leap_year"
},
"Days_in_week": {
"name": "Days_in_week",
"documentation": "Number of days in a week.",
"type": "Integer",
"value": 7
},
"Months_in_year": {
"name": "Months_in_year",
"documentation": "Number of months in a year.",
"type": "Integer",
"value": 12
},
"Min_timezone_hour": {
"name": "Min_timezone_hour",
"documentation": "Minimum hour value of a timezone according to ISO 8601 (note that the -ve sign is supplied in the `ISO8601_TIMEZONE` class).",
"type": "Integer",
"value": 12
},
"Max_timezone_hour": {
"name": "Max_timezone_hour",
"documentation": "Maximum hour value of a timezone according to ISO 8601.",
"type": "Integer",
"value": 14
},
"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
},
"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
}
},
"functions": {
"valid_year": {
"name": "valid_year",
"documentation": "True if `y >= 0`.",
"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",
"documentation": "True if `m >= 1 and m <= months_in_year`.",
"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: return True if Parameters
|
|||
Reference equality for reference types, value equality for value types. Parameters
|
|||
Create new instance of a type. |
|||
Type name of an object as a string. May include generic parameters, as in |
|||
Any.not_equal alias "!=", "≠" ( |
True if current object not equal to |
||
(abstract) Ordered.less_than alias "<" ( |
Arithmetic value comparison. Returns True if current object is less than In conjunction with |
||
Ordered.less_than_or_equal alias "⇐", "≤" ( |
True if current object less than or equal to |
||
Ordered.greater_than alias ">" ( |
True if current object greater than |
||
Ordered.greater_than_or_equal alias ">=", "≥" ( |
True if current object greater than or equal to |
||
{
"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 |
| 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 |
|||||
Time_Definitions.Seconds_in_minute: |
Number of seconds in a minute. |
||||
Time_Definitions.Minutes_in_hour: |
Number of minutes in an hour. |
||||
Time_Definitions.Hours_in_day: |
Number of clock hours in a day, i.e. 24. |
||||
Time_Definitions.Average_days_in_month: |
Used for conversions of durations containing months to days and / or seconds. |
||||
Time_Definitions.Max_days_in_month: |
Maximum number of days in any month. |
||||
Time_Definitions.Days_in_year: |
Calendar days in a normal year, i.e. 365. |
||||
Time_Definitions.Average_days_in_year: |
Used for conversions of durations containing years to days and / or seconds. |
||||
Time_Definitions.Days_in_leap_year: |
Calendar days in a standard leap year, i.e. 366. |
||||
Time_Definitions.Max_days_in_year: |
Maximum number of days in a year, i.e. accounting for leap years. |
||||
Time_Definitions.Days_in_week: |
Number of days in a week. |
||||
Time_Definitions.Months_in_year: |
Number of months in a year. |
||||
Time_Definitions.Min_timezone_hour: |
Minimum hour value of a timezone according to ISO 8601 (note that the -ve sign is supplied in the |
||||
Time_Definitions.Max_timezone_hour: |
Maximum hour value of a timezone according to ISO 8601. |
||||
Time_Definitions.Nominal_days_in_month: |
Used for conversions of durations containing months to days and / or seconds. |
||||
Time_Definitions.Nominal_days_in_year: |
Used for conversions of durations containing years to days and / or seconds. |
||||
Attributes |
|||||
value: |
Representation of all descendants is a single String. |
||||
Functions |
|||||
Value equality: return True if Parameters
|
|||||
Reference equality for reference types, value equality for value types. Parameters
|
|||||
Create new instance of a type. |
|||||
Type name of an object as a string. May include generic parameters, as in |
|||||
Any.not_equal alias "!=", "≠" ( |
True if current object not equal to |
||||
(abstract) Ordered.less_than alias "<" ( |
Arithmetic value comparison. Returns True if current object is less than In conjunction with |
||||
Ordered.less_than_or_equal alias "⇐", "≤" ( |
True if current object less than or equal to |
||||
Ordered.greater_than alias ">" ( |
True if current object greater than |
||||
Ordered.greater_than_or_equal alias ">=", "≥" ( |
True if current object greater than or equal to |
||||
Time_Definitions.valid_year ( |
True if |
||||
Time_Definitions.valid_month ( |
True if |
||||
Time_Definitions.valid_day ( |
True if |
||||
Time_Definitions.valid_hour ( |
True if |
||||
Time_Definitions.valid_minute ( |
True if |
||||
Time_Definitions.valid_second ( |
True if |
||||
Time_Definitions.valid_fractional_second ( |
True if |
||||
Time_Definitions.valid_iso8601_date ( |
String is a valid ISO 8601 date, i.e. takes the complete form:
Where:
The combinations of |
||||
Time_Definitions.valid_iso8601_time ( |
String is a valid ISO 8601 date, i.e. takes the form:
with an additional optional timezone indicator of:
Where:
|
||||
Time_Definitions.valid_iso8601_date_time ( |
String is a valid ISO 8601 date-time, i.e. takes the form:
|
||||
Time_Definitions.valid_iso8601_duration ( |
String is a valid ISO 8601 duration, i.e. takes the form:
Where each nn represents a number of years, months, etc. 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 |
||||
{
"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 (): |
Extract the year part of the date as an Integer. |
1..1 |
month (): |
Extract the month part of the date as an Integer, or return 0 if not present. |
1..1 |
day (): |
Extract the day part of the date as an Integer, or return 0 if not present. |
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. |
1..1 |
add alias "+" ( |
Arithmetic addition of a duration to a date. |
1..1 |
subtract alias "-" ( |
Arithmetic subtraction of a duration from a date. |
1..1 |
diff alias "-" ( |
Difference of two dates. |
1..1 |
add_nominal alias "++" ( |
Addition of nominal duration represented by
|
1..1 |
subtract_nominal alias "--" ( |
Subtraction of nominal duration represented by |
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 |
|||||
Time_Definitions.Seconds_in_minute: |
Number of seconds in a minute. |
||||
Time_Definitions.Minutes_in_hour: |
Number of minutes in an hour. |
||||
Time_Definitions.Hours_in_day: |
Number of clock hours in a day, i.e. 24. |
||||
Time_Definitions.Average_days_in_month: |
Used for conversions of durations containing months to days and / or seconds. |
||||
Time_Definitions.Max_days_in_month: |
Maximum number of days in any month. |
||||
Time_Definitions.Days_in_year: |
Calendar days in a normal year, i.e. 365. |
||||
Time_Definitions.Average_days_in_year: |
Used for conversions of durations containing years to days and / or seconds. |
||||
Time_Definitions.Days_in_leap_year: |
Calendar days in a standard leap year, i.e. 366. |
||||
Time_Definitions.Max_days_in_year: |
Maximum number of days in a year, i.e. accounting for leap years. |
||||
Time_Definitions.Days_in_week: |
Number of days in a week. |
||||
Time_Definitions.Months_in_year: |
Number of months in a year. |
||||
Time_Definitions.Min_timezone_hour: |
Minimum hour value of a timezone according to ISO 8601 (note that the -ve sign is supplied in the |
||||
Time_Definitions.Max_timezone_hour: |
Maximum hour value of a timezone according to ISO 8601. |
||||
Time_Definitions.Nominal_days_in_month: |
Used for conversions of durations containing months to days and / or seconds. |
||||
Time_Definitions.Nominal_days_in_year: |
Used for conversions of durations containing years to days and / or seconds. |
||||
Attributes |
|||||
Iso8601_type.value: |
Representation of all descendants is a single String. |
||||
Functions |
|||||
Value equality: return True if Parameters
|
|||||
Reference equality for reference types, value equality for value types. Parameters
|
|||||
Create new instance of a type. |
|||||
Type name of an object as a string. May include generic parameters, as in |
|||||
Any.not_equal alias "!=", "≠" ( |
True if current object not equal to |
||||
(abstract) Ordered.less_than alias "<" ( |
Arithmetic value comparison. Returns True if current object is less than In conjunction with |
||||
Ordered.less_than_or_equal alias "⇐", "≤" ( |
True if current object less than or equal to |
||||
Ordered.greater_than alias ">" ( |
True if current object greater than |
||||
Ordered.greater_than_or_equal alias ">=", "≥" ( |
True if current object greater than or equal to |
||||
Time_Definitions.valid_year ( |
True if |
||||
Time_Definitions.valid_month ( |
True if |
||||
Time_Definitions.valid_day ( |
True if |
||||
Time_Definitions.valid_hour ( |
True if |
||||
Time_Definitions.valid_minute ( |
True if |
||||
Time_Definitions.valid_second ( |
True if |
||||
Time_Definitions.valid_fractional_second ( |
True if |
||||
Time_Definitions.valid_iso8601_date ( |
String is a valid ISO 8601 date, i.e. takes the complete form:
Where:
The combinations of |
||||
Time_Definitions.valid_iso8601_time ( |
String is a valid ISO 8601 date, i.e. takes the form:
with an additional optional timezone indicator of:
Where:
|
||||
Time_Definitions.valid_iso8601_date_time ( |
String is a valid ISO 8601 date-time, i.e. takes the form:
|
||||
Time_Definitions.valid_iso8601_duration ( |
String is a valid ISO 8601 duration, i.e. takes the form:
Where each nn represents a number of years, months, etc. 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 (): |
Extract the year part of the date as an Integer. |
||||
month (): |
Extract the month part of the date as an Integer, or return 0 if not present. |
||||
day (): |
Extract the day part of the date as an Integer, or return 0 if not present. |
||||
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. |
||||
add alias "+" ( |
Arithmetic addition of a duration to a date. |
||||
subtract alias "-" ( |
Arithmetic subtraction of a duration from a date. |
||||
diff alias "-" ( |
Difference of two dates. |
||||
add_nominal alias "++" ( |
Addition of nominal duration represented by
|
||||
subtract_nominal alias "--" ( |
Subtraction of nominal duration represented by |
||||
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` (compact)\n* a partial invariant.\n\nSee `Time_definitions._valid_iso8601_date()_` for validity.",
"ancestors": [
"Iso8601_type"
],
"functions": {
"year": {
"name": "year",
"documentation": "Extract the year part of the date as an Integer.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"month": {
"name": "month",
"documentation": "Extract the month part of the date as an Integer, or return 0 if not present.",
"pre_conditions": {
"Pre": "not month_unknown"
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"day": {
"name": "day",
"documentation": "Extract the day part of the date as an Integer, or return 0 if not present.",
"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"
}
},
"add": {
"name": "add",
"aliases": [
"+"
],
"documentation": "Arithmetic addition of a duration to a date.",
"parameters": {
"a_diff": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "a_diff",
"type": "Iso8601_duration"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Iso8601_date"
}
},
"subtract": {
"name": "subtract",
"aliases": [
"-"
],
"documentation": "Arithmetic subtraction of a duration from a date.",
"parameters": {
"a_diff": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "a_diff",
"type": "Iso8601_duration"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Iso8601_date"
}
},
"diff": {
"name": "diff",
"aliases": [
"-"
],
"documentation": "Difference of two dates.",
"parameters": {
"a_date": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "a_date",
"type": "Iso8601_date"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Iso8601_duration"
}
},
"add_nominal": {
"name": "add_nominal",
"aliases": [
"++"
],
"documentation": "Addition of nominal duration represented by `_a_diff_`. For example, a duration of `'P1Y'` means advance to the same date next year, with the exception of the date 29 February in a leap year, to which the addition of a nominal year will result in 28 February of the following year. Similarly, `'P1M'` is understood here as a nominal month, the addition of which will result in one of:\n\n* the same day in the following month, if it exists, or;\n* one or two days less where the following month is shorter, or;\n* in the case of adding a month to the date 31 Jan, the result will be 28 Feb in a non-leap year (i.e. three less) and 29 Feb in a leap year (i.e. two less).",
"parameters": {
"a_diff": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "a_diff",
"type": "Iso8601_duration"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Iso8601_date"
}
},
"subtract_nominal": {
"name": "subtract_nominal",
"aliases": [
"--"
],
"documentation": "Subtraction of nominal duration represented by `_a_diff_`. See `_add_nominal_()` for semantics.",
"parameters": {
"a_diff": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "a_diff",
"type": "Iso8601_duration"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Iso8601_date"
}
}
},
"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 (): |
Extract the hour part of the date/time as an Integer. |
||
1..1 |
minute (): |
Extract the minute part of the time as an Integer, or return 0 if not present. |
||
1..1 |
second (): |
Extract the integral seconds part of the time (i.e. prior to any decimal sign) as an Integer, or return 0 if not present. |
||
1..1 |
fractional_second (): |
Extract the fractional seconds part of the time (i.e. following to any decimal sign) as a Real, or return 0.0 if not present. |
||
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 |
||
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 |
||
1..1 |
has_fractional_second (): |
True if the |
||
1..1 |
as_string (): |
Return string value in extended format. |
||
1..1 |
add alias "+" ( |
Arithmetic addition of a duration to a time. |
||
1..1 |
subtract alias "-" ( |
Arithmetic subtraction of a duration from a time. |
||
1..1 |
diff alias "-" ( |
Difference of two times. |
||
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 |
|||||
Time_Definitions.Seconds_in_minute: |
Number of seconds in a minute. |
||||
Time_Definitions.Minutes_in_hour: |
Number of minutes in an hour. |
||||
Time_Definitions.Hours_in_day: |
Number of clock hours in a day, i.e. 24. |
||||
Time_Definitions.Average_days_in_month: |
Used for conversions of durations containing months to days and / or seconds. |
||||
Time_Definitions.Max_days_in_month: |
Maximum number of days in any month. |
||||
Time_Definitions.Days_in_year: |
Calendar days in a normal year, i.e. 365. |
||||
Time_Definitions.Average_days_in_year: |
Used for conversions of durations containing years to days and / or seconds. |
||||
Time_Definitions.Days_in_leap_year: |
Calendar days in a standard leap year, i.e. 366. |
||||
Time_Definitions.Max_days_in_year: |
Maximum number of days in a year, i.e. accounting for leap years. |
||||
Time_Definitions.Days_in_week: |
Number of days in a week. |
||||
Time_Definitions.Months_in_year: |
Number of months in a year. |
||||
Time_Definitions.Min_timezone_hour: |
Minimum hour value of a timezone according to ISO 8601 (note that the -ve sign is supplied in the |
||||
Time_Definitions.Max_timezone_hour: |
Maximum hour value of a timezone according to ISO 8601. |
||||
Time_Definitions.Nominal_days_in_month: |
Used for conversions of durations containing months to days and / or seconds. |
||||
Time_Definitions.Nominal_days_in_year: |
Used for conversions of durations containing years to days and / or seconds. |
||||
Attributes |
|||||
Iso8601_type.value: |
Representation of all descendants is a single String. |
||||
Functions |
|||||
Value equality: return True if Parameters
|
|||||
Reference equality for reference types, value equality for value types. Parameters
|
|||||
Create new instance of a type. |
|||||
Type name of an object as a string. May include generic parameters, as in |
|||||
Any.not_equal alias "!=", "≠" ( |
True if current object not equal to |
||||
(abstract) Ordered.less_than alias "<" ( |
Arithmetic value comparison. Returns True if current object is less than In conjunction with |
||||
Ordered.less_than_or_equal alias "⇐", "≤" ( |
True if current object less than or equal to |
||||
Ordered.greater_than alias ">" ( |
True if current object greater than |
||||
Ordered.greater_than_or_equal alias ">=", "≥" ( |
True if current object greater than or equal to |
||||
Time_Definitions.valid_year ( |
True if |
||||
Time_Definitions.valid_month ( |
True if |
||||
Time_Definitions.valid_day ( |
True if |
||||
Time_Definitions.valid_hour ( |
True if |
||||
Time_Definitions.valid_minute ( |
True if |
||||
Time_Definitions.valid_second ( |
True if |
||||
Time_Definitions.valid_fractional_second ( |
True if |
||||
Time_Definitions.valid_iso8601_date ( |
String is a valid ISO 8601 date, i.e. takes the complete form:
Where:
The combinations of |
||||
Time_Definitions.valid_iso8601_time ( |
String is a valid ISO 8601 date, i.e. takes the form:
with an additional optional timezone indicator of:
Where:
|
||||
Time_Definitions.valid_iso8601_date_time ( |
String is a valid ISO 8601 date-time, i.e. takes the form:
|
||||
Time_Definitions.valid_iso8601_duration ( |
String is a valid ISO 8601 duration, i.e. takes the form:
Where each nn represents a number of years, months, etc. 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 |
||||
hour (): |
Extract the hour part of the date/time as an Integer. |
||||
minute (): |
Extract the minute part of the time as an Integer, or return 0 if not present. |
||||
second (): |
Extract the integral seconds part of the time (i.e. prior to any decimal sign) as an Integer, or return 0 if not present. |
||||
fractional_second (): |
Extract the fractional seconds part of the time (i.e. following to any decimal sign) as a Real, or return 0.0 if not present. |
||||
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 |
||||
has_fractional_second (): |
True if the |
||||
as_string (): |
Return string value in extended format. |
||||
add alias "+" ( |
Arithmetic addition of a duration to a time. |
||||
subtract alias "-" ( |
Arithmetic subtraction of a duration from a time. |
||||
diff alias "-" ( |
Difference of two times. |
||||
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": "Extract the hour part of the date/time as an Integer.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"minute": {
"name": "minute",
"documentation": "Extract the minute part of the time as an Integer, or return 0 if not present.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"second": {
"name": "second",
"documentation": "Extract the integral seconds part of the time (i.e. prior to any decimal sign) as an Integer, or return 0 if not present.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"fractional_second": {
"name": "fractional_second",
"documentation": "Extract the fractional seconds part of the time (i.e. following to any decimal sign) as a Real, or return 0.0 if not present.",
"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 significant (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"
}
},
"add": {
"name": "add",
"aliases": [
"+"
],
"documentation": "Arithmetic addition of a duration to a time.",
"parameters": {
"a_diff": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "a_diff",
"type": "Iso8601_duration"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Iso8601_time"
}
},
"subtract": {
"name": "subtract",
"aliases": [
"-"
],
"documentation": "Arithmetic subtraction of a duration from a time.",
"parameters": {
"a_diff": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "a_diff",
"type": "Iso8601_duration"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Iso8601_time"
}
},
"diff": {
"name": "diff",
"aliases": [
"-"
],
"documentation": "Difference of two times.",
"parameters": {
"a_time": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "a_time",
"type": "Iso8601_time"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Iso8601_duration"
}
}
},
"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 (): |
Extract the year part of the date as an Integer. |
1..1 |
month (): |
Extract the month part of the date/time as an Integer, or return 0 if not present. |
1..1 |
day (): |
Extract the day part of the date/time as an Integer, or return 0 if not present. |
1..1 |
hour (): |
Extract the hour part of the date/time as an Integer, or return 0 if not present. |
1..1 |
minute (): |
Extract the minute part of the date/time as an Integer, or return 0 if not present. |
1..1 |
second (): |
Extract the integral seconds part of the date/time (i.e. prior to any decimal sign) as an Integer, or return 0 if not present. |
1..1 |
fractional_second (): |
Extract the fractional seconds part of the date/time (i.e. following to any decimal sign) as a Real, or return 0.0 if not present. |
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 |
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 |
1..1 |
has_fractional_second (): |
True if the |
1..1 |
as_string (): |
Return the string value in extended format. |
1..1 |
add alias "+" ( |
Arithmetic addition of a duration to a date/time. |
1..1 |
subtract alias "-" ( |
Arithmetic subtraction of a duration from a date/time. |
1..1 |
diff alias "-" ( |
Difference of two date/times. |
1..1 |
add_nominal alias "++" ( |
Addition of nominal duration represented by |
1..1 |
subtract_nominal alias "--" ( |
Subtraction of nominal duration represented by |
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 |
|||||
Time_Definitions.Seconds_in_minute: |
Number of seconds in a minute. |
||||
Time_Definitions.Minutes_in_hour: |
Number of minutes in an hour. |
||||
Time_Definitions.Hours_in_day: |
Number of clock hours in a day, i.e. 24. |
||||
Time_Definitions.Average_days_in_month: |
Used for conversions of durations containing months to days and / or seconds. |
||||
Time_Definitions.Max_days_in_month: |
Maximum number of days in any month. |
||||
Time_Definitions.Days_in_year: |
Calendar days in a normal year, i.e. 365. |
||||
Time_Definitions.Average_days_in_year: |
Used for conversions of durations containing years to days and / or seconds. |
||||
Time_Definitions.Days_in_leap_year: |
Calendar days in a standard leap year, i.e. 366. |
||||
Time_Definitions.Max_days_in_year: |
Maximum number of days in a year, i.e. accounting for leap years. |
||||
Time_Definitions.Days_in_week: |
Number of days in a week. |
||||
Time_Definitions.Months_in_year: |
Number of months in a year. |
||||
Time_Definitions.Min_timezone_hour: |
Minimum hour value of a timezone according to ISO 8601 (note that the -ve sign is supplied in the |
||||
Time_Definitions.Max_timezone_hour: |
Maximum hour value of a timezone according to ISO 8601. |
||||
Time_Definitions.Nominal_days_in_month: |
Used for conversions of durations containing months to days and / or seconds. |
||||
Time_Definitions.Nominal_days_in_year: |
Used for conversions of durations containing years to days and / or seconds. |
||||
Attributes |
|||||
Iso8601_type.value: |
Representation of all descendants is a single String. |
||||
Functions |
|||||
Value equality: return True if Parameters
|
|||||
Reference equality for reference types, value equality for value types. Parameters
|
|||||
Create new instance of a type. |
|||||
Type name of an object as a string. May include generic parameters, as in |
|||||
Any.not_equal alias "!=", "≠" ( |
True if current object not equal to |
||||
(abstract) Ordered.less_than alias "<" ( |
Arithmetic value comparison. Returns True if current object is less than In conjunction with |
||||
Ordered.less_than_or_equal alias "⇐", "≤" ( |
True if current object less than or equal to |
||||
Ordered.greater_than alias ">" ( |
True if current object greater than |
||||
Ordered.greater_than_or_equal alias ">=", "≥" ( |
True if current object greater than or equal to |
||||
Time_Definitions.valid_year ( |
True if |
||||
Time_Definitions.valid_month ( |
True if |
||||
Time_Definitions.valid_day ( |
True if |
||||
Time_Definitions.valid_hour ( |
True if |
||||
Time_Definitions.valid_minute ( |
True if |
||||
Time_Definitions.valid_second ( |
True if |
||||
Time_Definitions.valid_fractional_second ( |
True if |
||||
Time_Definitions.valid_iso8601_date ( |
String is a valid ISO 8601 date, i.e. takes the complete form:
Where:
The combinations of |
||||
Time_Definitions.valid_iso8601_time ( |
String is a valid ISO 8601 date, i.e. takes the form:
with an additional optional timezone indicator of:
Where:
|
||||
Time_Definitions.valid_iso8601_date_time ( |
String is a valid ISO 8601 date-time, i.e. takes the form:
|
||||
Time_Definitions.valid_iso8601_duration ( |
String is a valid ISO 8601 duration, i.e. takes the form:
Where each nn represents a number of years, months, etc. 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 |
||||
year (): |
Extract the year part of the date as an Integer. |
||||
month (): |
Extract the month part of the date/time as an Integer, or return 0 if not present. |
||||
day (): |
Extract the day part of the date/time as an Integer, or return 0 if not present. |
||||
hour (): |
Extract the hour part of the date/time as an Integer, or return 0 if not present. |
||||
minute (): |
Extract the minute part of the date/time as an Integer, or return 0 if not present. |
||||
second (): |
Extract the integral seconds part of the date/time (i.e. prior to any decimal sign) as an Integer, or return 0 if not present. |
||||
fractional_second (): |
Extract the fractional seconds part of the date/time (i.e. following to any decimal sign) as a Real, or return 0.0 if not present. |
||||
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 |
||||
has_fractional_second (): |
True if the |
||||
as_string (): |
Return the string value in extended format. |
||||
add alias "+" ( |
Arithmetic addition of a duration to a date/time. |
||||
subtract alias "-" ( |
Arithmetic subtraction of a duration from a date/time. |
||||
diff alias "-" ( |
Difference of two date/times. |
||||
add_nominal alias "++" ( |
Addition of nominal duration represented by |
||||
subtract_nominal alias "--" ( |
Subtraction of nominal duration represented by |
||||
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": "Extract the year part of the date as an Integer.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"month": {
"name": "month",
"documentation": "Extract the month part of the date/time as an Integer, or return 0 if not present.",
"pre_conditions": {
"Pre": "not month_unknown"
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"day": {
"name": "day",
"documentation": "Extract the day part of the date/time as an Integer, or return 0 if not present.",
"pre_conditions": {
"Pre": "not day_unknown"
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"hour": {
"name": "hour",
"documentation": "Extract the hour part of the date/time as an Integer, or return 0 if not present.",
"pre_conditions": {
"Pre": "not hour_unknown"
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"minute": {
"name": "minute",
"documentation": "Extract the minute part of the date/time as an Integer, or return 0 if not present.",
"pre_conditions": {
"Pre": "not minute_unknown"
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"second": {
"name": "second",
"documentation": "Extract the integral seconds part of the date/time (i.e. prior to any decimal sign) as an Integer, or return 0 if not present.",
"pre_conditions": {
"Pre": "not second_unknown"
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"fractional_second": {
"name": "fractional_second",
"documentation": "Extract the fractional seconds part of the date/time (i.e. following to any decimal sign) as a Real, or return 0.0 if not present.",
"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 significant (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"
}
},
"add": {
"name": "add",
"aliases": [
"+"
],
"documentation": "Arithmetic addition of a duration to a date/time.",
"parameters": {
"a_diff": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "a_diff",
"type": "Iso8601_duration"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Iso8601_date_time"
}
},
"subtract": {
"name": "subtract",
"aliases": [
"-"
],
"documentation": "Arithmetic subtraction of a duration from a date/time.",
"parameters": {
"a_diff": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "a_diff",
"type": "Iso8601_duration"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Iso8601_date_time"
}
},
"diff": {
"name": "diff",
"aliases": [
"-"
],
"documentation": "Difference of two date/times.",
"parameters": {
"a_date_time": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "a_date_time",
"type": "Iso8601_date_time"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Iso8601_duration"
}
},
"add_nominal": {
"name": "add_nominal",
"aliases": [
"++"
],
"documentation": "Addition of nominal duration represented by `_a_diff_`. See `Iso8601_date._add_nominal_()` for semantics.",
"parameters": {
"a_diff": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "a_diff",
"type": "Iso8601_duration"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Iso8601_date"
}
},
"subtract_nominal": {
"name": "subtract_nominal",
"aliases": [
"--"
],
"documentation": "Subtraction of nominal duration represented by `_a_diff_`. See `_add_nominal_()` for semantics.",
"parameters": {
"a_diff": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "a_diff",
"type": "Iso8601_duration"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Iso8601_date"
}
}
},
"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. The
|
|||
Inherit |
||||
Functions |
Signature |
Meaning |
||
1..1 |
is_extended (): |
Returns True. |
||
1..1 |
is_partial (): |
Returns False. |
||
1..1 |
years (): |
Number of years in the |
||
1..1 |
months (): |
Number of months in the |
||
1..1 |
days (): |
Number of days in the |
||
1..1 |
hours (): |
Number of hours in the |
||
1..1 |
minutes (): |
Number of minutes in the |
||
1..1 |
seconds (): |
Number of seconds in the |
||
1..1 |
fractional_seconds (): |
Fractional seconds in the |
||
1..1 |
weeks (): |
Number of weeks in the |
||
1..1 |
is_decimal_sign_comma (): |
True if this time has a decimal part indicated by ',' (comma) rather than '.' (period). |
||
1..1 |
to_seconds (): |
Total number of seconds equivalent (including fractional) of entire duration. Where non-definite elements such as year and month (i.e. 'Y' and 'M') are included, the corresponding 'average' durations from |
||
1..1 |
as_string (): |
Return the duration string value. |
||
1..1 |
add alias "+" ( |
Arithmetic addition of a duration to a duration, via conversion to seconds, using |
||
1..1 |
subtract alias "-" ( |
Arithmetic subtraction of a duration from a duration, via conversion to seconds, using |
||
1..1 |
multiply alias "*" ( |
Arithmetic multiplication a duration by a number. |
||
1..1 |
divide alias "/" ( |
Arithmetic division of a duration by a number. |
||
1..1 |
negative alias "-" (): |
Generate negative of current duration 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. The
|
|||||
Inherits: Any, Ordered, Temporal, Time_Definitions, Iso8601_type |
|||||
Constants |
|||||
Time_Definitions.Seconds_in_minute: |
Number of seconds in a minute. |
||||
Time_Definitions.Minutes_in_hour: |
Number of minutes in an hour. |
||||
Time_Definitions.Hours_in_day: |
Number of clock hours in a day, i.e. 24. |
||||
Time_Definitions.Average_days_in_month: |
Used for conversions of durations containing months to days and / or seconds. |
||||
Time_Definitions.Max_days_in_month: |
Maximum number of days in any month. |
||||
Time_Definitions.Days_in_year: |
Calendar days in a normal year, i.e. 365. |
||||
Time_Definitions.Average_days_in_year: |
Used for conversions of durations containing years to days and / or seconds. |
||||
Time_Definitions.Days_in_leap_year: |
Calendar days in a standard leap year, i.e. 366. |
||||
Time_Definitions.Max_days_in_year: |
Maximum number of days in a year, i.e. accounting for leap years. |
||||
Time_Definitions.Days_in_week: |
Number of days in a week. |
||||
Time_Definitions.Months_in_year: |
Number of months in a year. |
||||
Time_Definitions.Min_timezone_hour: |
Minimum hour value of a timezone according to ISO 8601 (note that the -ve sign is supplied in the |
||||
Time_Definitions.Max_timezone_hour: |
Maximum hour value of a timezone according to ISO 8601. |
||||
Time_Definitions.Nominal_days_in_month: |
Used for conversions of durations containing months to days and / or seconds. |
||||
Time_Definitions.Nominal_days_in_year: |
Used for conversions of durations containing years to days and / or seconds. |
||||
Attributes |
|||||
Iso8601_type.value: |
Representation of all descendants is a single String. |
||||
Functions |
|||||
Value equality: return True if Parameters
|
|||||
Reference equality for reference types, value equality for value types. Parameters
|
|||||
Create new instance of a type. |
|||||
Type name of an object as a string. May include generic parameters, as in |
|||||
Any.not_equal alias "!=", "≠" ( |
True if current object not equal to |
||||
(abstract) Ordered.less_than alias "<" ( |
Arithmetic value comparison. Returns True if current object is less than In conjunction with |
||||
Ordered.less_than_or_equal alias "⇐", "≤" ( |
True if current object less than or equal to |
||||
Ordered.greater_than alias ">" ( |
True if current object greater than |
||||
Ordered.greater_than_or_equal alias ">=", "≥" ( |
True if current object greater than or equal to |
||||
Time_Definitions.valid_year ( |
True if |
||||
Time_Definitions.valid_month ( |
True if |
||||
Time_Definitions.valid_day ( |
True if |
||||
Time_Definitions.valid_hour ( |
True if |
||||
Time_Definitions.valid_minute ( |
True if |
||||
Time_Definitions.valid_second ( |
True if |
||||
Time_Definitions.valid_fractional_second ( |
True if |
||||
Time_Definitions.valid_iso8601_date ( |
String is a valid ISO 8601 date, i.e. takes the complete form:
Where:
The combinations of |
||||
Time_Definitions.valid_iso8601_time ( |
String is a valid ISO 8601 date, i.e. takes the form:
with an additional optional timezone indicator of:
Where:
|
||||
Time_Definitions.valid_iso8601_date_time ( |
String is a valid ISO 8601 date-time, i.e. takes the form:
|
||||
Time_Definitions.valid_iso8601_duration ( |
String is a valid ISO 8601 duration, i.e. takes the form:
Where each nn represents a number of years, months, etc. Note: allowing the Parameters
Where each
|
||||
is_partial (): |
Returns False. |
||||
is_extended (): |
Returns True. |
||||
years (): |
Number of years in the |
||||
months (): |
Number of months in the |
||||
days (): |
Number of days in the |
||||
hours (): |
Number of hours in the |
||||
minutes (): |
Number of minutes in the |
||||
seconds (): |
Number of seconds in the |
||||
fractional_seconds (): |
Fractional seconds in the |
||||
weeks (): |
Number of weeks in the |
||||
is_decimal_sign_comma (): |
True if this time has a decimal part indicated by ',' (comma) rather than '.' (period). |
||||
to_seconds (): |
Total number of seconds equivalent (including fractional) of entire duration. Where non-definite elements such as year and month (i.e. 'Y' and 'M') are included, the corresponding 'average' durations from |
||||
as_string (): |
Return the duration string value. |
||||
add alias "+" ( |
Arithmetic addition of a duration to a duration, via conversion to seconds, using |
||||
subtract alias "-" ( |
Arithmetic subtraction of a duration from a duration, via conversion to seconds, using |
||||
multiply alias "*" ( |
Arithmetic multiplication a duration by a number. |
||||
divide alias "/" ( |
Arithmetic division of a duration by a number. |
||||
negative alias "-" (): |
Generate negative of current duration 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. The `_value_` attribute is a String in the format:\n\n* `P[nnY][nnM][nnW][nnD][T[nnH][nnM][nnS]]`\n\nNOTE: two deviations from ISO 8601 are supported, the first, to allow a negative sign, and the second allowing the 'W' designator to be mixed with other designators.",
"ancestors": [
"Iso8601_type"
],
"functions": {
"is_extended": {
"name": "is_extended",
"documentation": "Returns True.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"is_partial": {
"name": "is_partial",
"documentation": "Returns False.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"years": {
"name": "years",
"documentation": "Number of years in the `_value_`, i.e. the number preceding the `'Y'` in the `'YMD'` part, if one exists.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"months": {
"name": "months",
"documentation": "Number of months in the `_value_`, i.e. the value preceding the `'M'` in the `'YMD'` part, if one exists.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"days": {
"name": "days",
"documentation": "Number of days in the `_value_`, i.e. the number preceding the `'D'` in the `'YMD'` part, if one exists.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"hours": {
"name": "hours",
"documentation": "Number of hours in the `_value_`, i.e. the number preceding the `'H'` in the `'HMS'` part, if one exists.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"minutes": {
"name": "minutes",
"documentation": "Number of minutes in the `_value_`, i.e. the number preceding the `'M'` in the `'HMS'` part, if one exists.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"seconds": {
"name": "seconds",
"documentation": "Number of seconds in the `_value_`, i.e. the integer number preceding the `'S'` in the `'HMS'` part, if one exists.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"fractional_seconds": {
"name": "fractional_seconds",
"documentation": "Fractional seconds in the `_value_`, i.e. the decimal part of the number preceding the `'S'` in the `'HMS'` part, if one exists.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Real"
}
},
"weeks": {
"name": "weeks",
"documentation": "Number of weeks in the `_value_`, i.e. the value preceding the `W`, if one exists.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"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"
}
},
"to_seconds": {
"name": "to_seconds",
"documentation": "Total number of seconds equivalent (including fractional) of entire duration. Where non-definite elements such as year and month (i.e. 'Y' and 'M') are included, the corresponding 'average' durations from `Time_definitions` are used to compute the result.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Real"
}
},
"as_string": {
"name": "as_string",
"documentation": "Return the duration string value.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "String"
}
},
"add": {
"name": "add",
"aliases": [
"+"
],
"documentation": "Arithmetic addition of a duration to a duration, via conversion to seconds, using `Time_definitions._Average_days_in_year_` and `Time_definitions._Average_days_in_month_`",
"parameters": {
"a_val": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "a_val",
"type": "Iso8601_duration"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Iso8601_duration"
}
},
"subtract": {
"name": "subtract",
"aliases": [
"-"
],
"documentation": "Arithmetic subtraction of a duration from a duration, via conversion to seconds, using `Time_definitions._Average_days_in_year_` and `Time_definitions._Average_days_in_month_`",
"parameters": {
"a_val": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "a_val",
"type": "Iso8601_duration"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Iso8601_duration"
}
},
"multiply": {
"name": "multiply",
"aliases": [
"*"
],
"documentation": "Arithmetic multiplication a duration by a number.",
"parameters": {
"a_val": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "a_val",
"type": "Real"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Iso8601_duration"
}
},
"divide": {
"name": "divide",
"aliases": [
"/"
],
"documentation": "Arithmetic division of a duration by a number.",
"parameters": {
"a_val": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "a_val",
"type": "Real"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Iso8601_duration"
}
},
"negative": {
"name": "negative",
"aliases": [
"-"
],
"documentation": "Generate negative of current duration value.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Iso8601_duration"
}
}
},
"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 (): |
Extract the hour part of timezone, as an Integer in the range |
1..1 |
minute (): |
Extract the hour part of timezone, as an Integer, usually either 0 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. |
1..1 |
as_string (): |
Return timezone string in extended format. |
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 |
|||||
Time_Definitions.Seconds_in_minute: |
Number of seconds in a minute. |
||||
Time_Definitions.Minutes_in_hour: |
Number of minutes in an hour. |
||||
Time_Definitions.Hours_in_day: |
Number of clock hours in a day, i.e. 24. |
||||
Time_Definitions.Average_days_in_month: |
Used for conversions of durations containing months to days and / or seconds. |
||||
Time_Definitions.Max_days_in_month: |
Maximum number of days in any month. |
||||
Time_Definitions.Days_in_year: |
Calendar days in a normal year, i.e. 365. |
||||
Time_Definitions.Average_days_in_year: |
Used for conversions of durations containing years to days and / or seconds. |
||||
Time_Definitions.Days_in_leap_year: |
Calendar days in a standard leap year, i.e. 366. |
||||
Time_Definitions.Max_days_in_year: |
Maximum number of days in a year, i.e. accounting for leap years. |
||||
Time_Definitions.Days_in_week: |
Number of days in a week. |
||||
Time_Definitions.Months_in_year: |
Number of months in a year. |
||||
Time_Definitions.Min_timezone_hour: |
Minimum hour value of a timezone according to ISO 8601 (note that the -ve sign is supplied in the |
||||
Time_Definitions.Max_timezone_hour: |
Maximum hour value of a timezone according to ISO 8601. |
||||
Time_Definitions.Nominal_days_in_month: |
Used for conversions of durations containing months to days and / or seconds. |
||||
Time_Definitions.Nominal_days_in_year: |
Used for conversions of durations containing years to days and / or seconds. |
||||
Attributes |
|||||
Iso8601_type.value: |
Representation of all descendants is a single String. |
||||
Functions |
|||||
Value equality: return True if Parameters
|
|||||
Reference equality for reference types, value equality for value types. Parameters
|
|||||
Create new instance of a type. |
|||||
Type name of an object as a string. May include generic parameters, as in |
|||||
Any.not_equal alias "!=", "≠" ( |
True if current object not equal to |
||||
(abstract) Ordered.less_than alias "<" ( |
Arithmetic value comparison. Returns True if current object is less than In conjunction with |
||||
Ordered.less_than_or_equal alias "⇐", "≤" ( |
True if current object less than or equal to |
||||
Ordered.greater_than alias ">" ( |
True if current object greater than |
||||
Ordered.greater_than_or_equal alias ">=", "≥" ( |
True if current object greater than or equal to |
||||
Time_Definitions.valid_year ( |
True if |
||||
Time_Definitions.valid_month ( |
True if |
||||
Time_Definitions.valid_day ( |
True if |
||||
Time_Definitions.valid_hour ( |
True if |
||||
Time_Definitions.valid_minute ( |
True if |
||||
Time_Definitions.valid_second ( |
True if |
||||
Time_Definitions.valid_fractional_second ( |
True if |
||||
Time_Definitions.valid_iso8601_date ( |
String is a valid ISO 8601 date, i.e. takes the complete form:
Where:
The combinations of |
||||
Time_Definitions.valid_iso8601_time ( |
String is a valid ISO 8601 date, i.e. takes the form:
with an additional optional timezone indicator of:
Where:
|
||||
Time_Definitions.valid_iso8601_date_time ( |
String is a valid ISO 8601 date-time, i.e. takes the form:
|
||||
Time_Definitions.valid_iso8601_duration ( |
String is a valid ISO 8601 duration, i.e. takes the form:
Where each nn represents a number of years, months, etc. 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 (): |
Extract the hour part of timezone, as an Integer in the range |
||||
minute (): |
Extract the hour part of timezone, as an Integer, usually either 0 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. |
||||
as_string (): |
Return timezone string in extended format. |
||||
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": "Extract the hour part of timezone, as an Integer in the range `00 - 14`.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"minute": {
"name": "minute",
"documentation": "Extract the hour part of timezone, as an Integer, usually either 0 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 in extended format.",
"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"
}
}