Foreword
The Calendaring and Scheduling Consortium (“CalConnect”) is a global nonprofit organization with the aim to facilitate interoperability of technologies across usercentric systems and applications.
CalConnect works closely with liaison partners including international organizations such as ISO, OASIS and M3AAWG.
The procedures used to develop this document and those intended for its further maintenance are described in the CalConnect Directives.
In particular the different approval criteria needed for the different types of CalConnect documents should be noted. This document was drafted in accordance with the editorial rules of the CalConnect Directives.
Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights. CalConnect shall not be held responsible for identifying any or all such patent rights. Details of any patent rights identified during the development of the document will be in the Introduction and/or on the CalConnect list of patent declarations received (see www.calconnect.com/patents).
Any trade name used in this document is information given for the convenience of users and does not constitute an endorsement.
This document was prepared by Technical Committee DATETIME.
Introduction
ISO 8601:2004 has been the international standard for date and time representations and is applied widely, including in the RFC 5545 and RFC 6350 standards.
However, the representations provided in ISO 8601:2004 require fixedlength digits for time scale components, such as the 4digit year, does not accept negative values, and does not allow omission of a time scale component that has a zero value.
This document extends the “duration” representation defined in ISO 8601:2004 to fulfill the need of a flexiblelength representation, called the “explicit form”.
Date and time — Explicit representation
1. Scope
The purpose of this document is to provide:

a standard, declarative representation of date and time and time scale components called the “explicit form”;

a grouped time scale unit mechanism for grouping of date and time; and

new duration representations and mechanics for the calculation of date time formulas involving duration.
This document only supports date elements from the Gregorian calendar and times from the 24hour clock.
Date and time format representations described in this document utilizes numbers, alphabets and symbols defined in ISO/IEC 646. These representations are meant to be both human recognizable and machine readable. Character encoding of the representations is not covered in this document.
2. Normative references
The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.
ISO 86011:—, Date and time — Representation for information interchange — Part 1: Basic rules
3. Terms, definitions, symbols and abbreviated terms
For the purposes of this document, the terms and definitions given in ISO 86011:— and the following apply.
3.1. Terms and definitions
3.1.1.
explicit form
date and time representation that uses designator symbols to delimit time scale components
3.1.2.
designator symbols
characters used to denote units of a time scale component
3.1.3.
date time formula
expression that specifies modification of a date and time expression (ISO 86011:, Clause 3.1.3.1) with a duration (ISO 86011:, Clause 3.1.1.8)
3.1.4.
durational unit
time scale component (ISO 86011:, Clause 3.1.3.3) that compose the duration (ISO 86011:, Clause 3.1.1.8) date and time representation (ISO 86011:, Clause 3.1.3.2)
3.1.5.
grouped time scale unit
time scale unit (ISO 86011:, Clause 3.1.1.7) composed of a duration (ISO 86011:, Clause 3.1.1.8) expressed by one or more durational units (Clause 3.1.4)
3.2. Symbols
3.2.1. General
Representations specified in this document make use of symbols given in ISO 86011: and the following.
3.2.2. Time scale component symbols
c(feat)

the left side of representation statement where “c” is a time scale component (e.g. “year”) and “feat” is a feature, for example, “m” for a time scale component that accepts negative values
yearE

time scale component calendar year in explicit form
monthE

time scale component calendar month in explicit form
weekE

time scale component calendar week of year in explicit form
dayE

time scale component calendar day of month in explicit form
daykE

time scale component calendar day of week in explicit form
dayoE

time scale component calendar day of year in explicit form
hourE

time scale component clock hour in explicit form
minE

time scale component clock minute in explicit form
secE

time scale component clock second in explicit form
decE

time scale component decade in explicit form
centE

time scale component century in explicit form
3.2.3. Composite component symbols
dateE

the composite time scale components for the complete representation of a date as determined in Clause 6.2.1
timeE

the composite time scale components for the complete representation of a time of day as determined in Clause 6.3.1
shiftE

the composite time scale component for time shift in basic form with hours and minutes, as determined in Clause 6.4
durationE

the composite time scale units for the representation of a duration as determined in ISO 8601:2004
3.2.4. Symbols used in place of digits or signs
These symbols are used to represent characters in the date and time representations. They are used in representations only, and are replaced by one or more characters, as described, in expressions:
!

indicates that the token following this symbol is optional (may be omitted)
n

a positive integer or value, may be left absent to signify an unbounded value
i

a positive integer
negi

a positive or negative integer; equivalent to [!][""][i]
3.2.5. Designator symbols
These symbols are used to represent designators in the date and time expressions:
“”

a minus sign represented by the character “`”` to indicate a negative value
“K”

the calendar day of week designator, represented by the character “K”, preceding a data element which represents the ordinal number of a calendar day within a calendar week
“J”

the decade designator, represented by the character “J”, preceding a data element which represents the number of decades
“Y”

the year designator, represented by the character “Y”, preceding a data element which represents the number of years
“M”

the month or minute designator, represented by the character “M”, preceding a data element which represents the number of months or minutes
“W”

the week designator, represented by the character “W”, preceding a data element which represents the ordinal number of a calendar week within the calendar year
“O”

the calendar day of year designator, represented by the character “O”, preceding a data element which represents the ordinal number of a calendar day within a calendar year
“D”

the day of month designator, represented by the character “D”, preceding a data element which represents the number of days in a month
“H”

the hour designator, represented by the character “H”, preceding a data element which represents the number of hours
“S”

the second designator, represented by the character “S”, preceding a data element which represents the number of seconds
“T”

the time designator, represented by character “T”, indicates:

the start of the representation of local time of day to designate local time of day expressions as such,

the start of the representation of the time of day in date and time of day expressions,

the start of the representation of the number of hours, minutes or seconds in expressions of duration

“P”

the duration designator, represented by the character “P”, preceding the component which represents the duration
“B”

the suffix designator to represent years before year one, represented by the character “B”, placed after the time scale components of calendar year, decade and century.
“Z”

the UTC designator, represented by the character “Z”, added to the end of a time representation to indicate that a time of day is represented as UTC of day.
“G”

the grouped time scale unit prefix designator, represented by the character “G”, indicates a grouping calculation applies to the subsequent time scale components until encountering the corresponding suffix designator.
“U”

the grouped time scale unit suffix designator, represented by the character “U”, indicates a grouping calculation applies to the preceding time scale components from the corresponding prefix designator.
 “x“

the representation of any character “x” as according to the textual representation of “x” in the ISO/IEC 646 repertoire
NOTE 1 Although “M” can be used to designate months or for minutes, its meaning is unambiguous in expressions because the time portion shall always be preceded by the time designator “T”.
NOTE 2 The designator symbol “J” is assigned from its ordinal position being the tenth letter of the English alphabet.
NOTE 3 The “G” and “U” designator symbols are used to demarcate the “grouped time scale unit” time scale components as they form the initial letters of the words “group” and “unit”.
3.2.6. Separator symbols
In date and time expressions and date and time representations, the following characters are used as separators.
“/” (solidus)

the “/” solidus character separates start and end times in the representation of a time interval, as well as the symbol ‘R’ from the remainder of a recurring time interval representation. A solidus may be replaced with a double hyphen [“—”] by mutual agreement of the communicating partners.
“.” (period) and “,” (comma)

the “.” period and “,” comma characters are decimal signs used to separate the integer part from the decimal fraction of a number.
4. Time scale components and units
4.1. General
Additional properties and the explicit forms of time scale units are represented in this clause.
4.2. Order of time scale units
This document refers to an “order” amongst time scale units, which is defined by the duration of a time scale unit relative to other time scale units. For example, since a single calendar month has a duration always greater than a single unit of calendar day, the former is considered of a higher order time scale unit than calendar day, and therefore the latter is also considered of a lower order time scale unit than the former.
The relative order of commonly used time scale units is specified below, with the higher listed entry considered a higher order time scale unit than a lower listed entry:

calendar century

calendar decade

calendar year

calendar month

calendar week

calendar day

clock hour

clock minute

clock second
NOTE a higher order time scale does not necessarily mean its duration can be expressed as an integer multiple of a lower order time scale, for example, in the case of calendar month (28, 29, 30 or 31 days) and calendar week (7 days).
4.3. Explicit forms
4.3.1. Value prefixing
Prefixing of the value with one or more “`0`”s (the number zero) to the integer [i] is allowed in the explicit forms of time scale components.
EXAMPLE
‘1M’, ‘01M’, and ‘0001M’ all describe the calendar month January.
4.3.2. Calendar year and years duration
The calendar year and years duration is represented as follows:
[i]["Y"]
EXAMPLE 1
‘12Y’, duration, twelve years
EXAMPLE 2
‘12Y’, date, year 12.
4.3.3. Calendar month and months duration
The calendar month and months duration is represented as follows:
[i]["M"]
EXAMPLE 1
‘6M’, duration, 6 months.
EXAMPLE 2
‘8M’, date, the month of August.
4.3.4. Calendar week of year and weeks duration
The calendar week of year number and weeks duration is represented as follows:
[i]["W"]
EXAMPLE 1
‘10W’, duration, ten weeks.
EXAMPLE 2
‘22W’, date, the twentysecond calendar week of a calendar year.
4.3.5. Calendar day of month and days duration
The calendar day of month and days duration is represented as follows:
[i]["D"]
EXAMPLE 1
‘130D’, duration, 130 days.
EXAMPLE 2
‘25D’, date, the twentyfifth (25) calendar day of a calendar month.
4.3.6. Calendar day of week
The calendar day of week is represented as the following time scale component:
[i]["K"]
Where,

[i] represents the ordinal day number in the calendar week; valid values of [i] are the integers 1 to 7, representing Monday to Sunday, in accordance with “The week calendar” specified in ISO 86011:, Clause 4.2.2.
EXAMPLE 1
‘1K’, calendar day of week Monday
EXAMPLE 2
‘3K’, calendar day of week Wednesday
EXAMPLE 3
‘7K’, calendar day of week Sunday
4.3.7. Calendar day of year
The calendar day of year is represented as the following time scale component:
[i]["O"]
EXAMPLE
‘351O’, ordinal day 351 of the calendar year
4.3.8. Clock hour and hours duration
Clock hour and hours duration is represented as follows:
[i]["H"]
EXAMPLE 1
‘36H’, duration, thirtysix hours.
EXAMPLE 2
‘6H’, time, the sixth clock hour.
4.3.9. Clock minute and minutes duration
Clock minute and minutes duration is represented as follows:
[i]["M"]
EXAMPLE 1
‘72M’, duration, 72 minutes.
EXAMPLE 2
‘56M’, time, the fiftysixth clock minute.
4.3.10. Clock second and seconds duration
Clock second and seconds duration is represented as follows:
[i]["S"]
EXAMPLE 1
‘300S’, duration, 300 seconds
EXAMPLE 2
‘28S’, duration, the twentyeighth clock second.
4.3.11. Decade
The decade is represented as the following time scale component:
[i]["J"]
EXAMPLE 1
‘196J’ in explicit form represents the decade of the 1960s, spanning the calendar years 1960 to 1969.
EXAMPLE 2
‘0J’ in explicit form represents the decade spanning calendar years 0 to 9.
4.3.12. Century
The century is represented as the following time scale component:
[i]["C"]
EXAMPLE 1
‘16C’, in explicit form represents the century of 1600s, spanning the calendar years 1600 to 1699.
EXAMPLE 2
‘0C’, in explicit form represents the century spanning the calendar years 00 to 99.
4.4. Negative values
4.4.1. General
Certain time scale components are allowed to accept a negative integer as their value. The following representation is used for value that accepts a positive or negative integer.
negi = [!]["``"][i]
In order to convert a time scale component to accept negative values, the following representation is used, where c is a time scale component unit. If the time scale component accepts an integer value of ‘0’, the value of the expression ‘0’ (negative zero) is considered equivalent to that of ‘0’.
c(m) = [negi][c]
Where,

[c] is the time scale component representation that accepts only positive [i];

[m] is a feature label indicating that the time scale component [c] accepts negative values.
This representation only applies to time scale components that describe a time scale unit. Specifically, it does not apply to durations, time intervals, and repeating time intervals.
EXAMPLE
If “c” is the time scale component yearE in explicit form (see Part 1 4.3.2 b)), c(m) means “calendar year accepting a negative value”. The explicit year representation [i][“Y”] becomes [negi][“Y”] when [i] is replaced with [negi], and expands to [!][“”]][i][“Y”], which accepts the representations [i]["Y`"] or [""]"Y"]. In this expression, the value of [i] or ["”`][i] represents an integer whose value identifies a calendar year.
4.4.2. Calendar year
When a negative calendar year represents a date, the negative value is to represent the number of years prior to year zero (0).
The representation for calendar year that accepts a negative value is as follows.
year(m)
EXAMPLE 1
‘12Y’ in date represents the the calendar year 12.
EXAMPLE 2
‘1Y’ in date represents the year immediately preceding year 0.
NOTE Year zero is expressed as ‘0Y’ in explicit form.
4.4.3. Calendar week of year
When a negative calendar week of year represents a date, the negative value is to represent the number of weeks counting in reverse from the end of the calendar year, where the last week of the year is represented by the integer value ‘1’.
The representation for calendar week of year that accepts a negative value is as follows.
week(m)
EXAMPLE 1
‘10W’ in date represents the tenth last week of the year.
EXAMPLE 2
‘3W’ in date represents the third last week of the year.
4.4.4. Calendar day of month
When a negative calendar day of month represents a date, the negative value is to represent the number of days counting in reverse from the end of the calendar month, where the last day of the month is represented by the integer value ‘1’.
The representation for calendar day of month that accepts a negative value is as follows.
day(m)
EXAMPLE 1
‘1D’ in date represents the last day of the month.
EXAMPLE 2
‘5D’ in date represents the fifth last day of the month.
4.4.5. Calendar day of year
When a negative calendar day of year represents a date, the negative value is to represent the number of days counting in reverse from the end of the calendar year, where the last day of the year is represented by the integer value ‘1’.
The representation for calendar day of year that accepts a negative value is as follows.
dayo(m)
EXAMPLE 1
‘7O’ in date represents the seventh last day of the calendar year, which is always December 25th.
EXAMPLE 2
‘306O’ in date represents February 29th for a leap year, February 28th otherwise.
4.4.6. Duration
A duration in the reverse direction, called a “negative duration” in this document, can be expressed using the following representation based on the duration representation specified in ISO 86012:, Clause 5.4.2. In this case, all time scale component within the duration representation must be positive.
duration(m) = [!]["`"`][positiveduration]
Where,

[positiveduration] is the [duration] representation that contains only time scale components that have positive [i].
EXAMPLE 1
‘P100D’ in date represents the duration of 100 days in the reverse direction.
EXAMPLE 2
‘P1Y3D’ in date represents the duration of one years and three days in the reverse direction.
EXAMPLE 3
‘P20Y3M’ describes a negative duration of twenty years and three months ago.
4.4.7. Calendar year before year one
A suffix addition to time scale components for calendar year, decade and century allows representation of calendar years before year one (1).
The representation is given as follows.
[c]["B"]
Where,

[c] is one of [yearE], [decE], [centE].
EXAMPLE 1
‘1YB’ the first year before year one, equivalent to the effect of ‘0Y’.
EXAMPLE 2
‘12YB’ the twelfth year before year one, equivalent to the effect of ‘11Y’.
EXAMPLE 3
‘12JB’ the twelfth decade before year one, equivalent to the effect of time interval ‘119/110’.
EXAMPLE 4
‘12CB’ the twelfth century before year one, equivalent to the effect of time interval ‘1190/1100’.
5. Grouped time scale units
5.1. General
A time scale unit can be grouped into a larger composite unit that can each be specifically referred to using representations provided in this clause.
5.2. Unit definition
A grouped time scale unit (“grouped unit”) defines a time scale unit that is a composite of smaller time scale units. Its representation is provided as follows and is denoted as [groupUnit] in this document.
["G"][durationUnits]["U"]
Where,

[“G”] is the grouping prefix designator;

[“U”] is the grouping suffix designator;

[durationUnits], one or more time scale components for expressing positive duration as specified in Clause 4.3.
The definition of a grouped unit is a continuous one, such that there is no gap between two adjacent grouped units.
EXAMPLE 1
‘G10DU’, every unit of the grouped unit is of ten days duration.
EXAMPLE 2
‘GT30MU’, every unit of the grouped unit is of thirty minutes duration.
EXAMPLE 3
‘G2DT6HU’, every unit of the grouped unit is of two days and six hours duration.
5.3. Unit value
The value of a grouped time scale unit is given with the following representation. This representation is denoted as [group] in this document.
group = [i][groupUnit]
Where,

[i] indicates the coefficient value of the grouped time scale unit;

[groupUnit] denotes an expression for a grouped time scale unit (Clause 5.2).
EXAMPLE 1
‘5G10DU’, the fifth unit of tenday groups.
EXAMPLE 2
‘20GT30MU’, the twentieth unit of thirtyminute groups.
EXAMPLE 3
‘2G2DT6HU’, the second unit of twoday groups.
EXAMPLE 4
‘201802GP14D2I’ and ‘2018Y02MGP14D2ID’ are complete date representations that indicates “the second fortnight of February 2018”, as specified by the rule “group every 14 days, second group”.
EXAMPLE 5
‘201803GP10D3I’ and ‘2018Y03MGP10D3ID’ are complete date representations that indicates “the third 10day block of March in 2018”, as specified by the rule “group every 10 days, third group”. A 10day block is a time grouping commonly used in East Asia.
EXAMPLE 6
’16:GPT15M1I:00’ and ‘T16HGPT15M1I0S’ are complete time representations that indicates “the first quarterhour of 16:00”, as specified by the rule “group every 15 minutes, first group”.
EXAMPLE 7
‘2018GP6M1I’ and ‘2018YGP6M1IM’ are date expressions (implied and explicit formats, respectively) of monthly precision that indicates “the first half of 2018”, as specified by the rule “group every 6 months, first group”, and therefore the grouping is specified in the [month] field. The resulting time interval is equivalent to the time interval expression ‘20180101/20180630’.
5.4. Application within representations
5.4.1. General
Grouped time scale units can be applied to date and time representations as replacements for any time scale unit components as long as the resulting expression is a valid one.
EXAMPLE 1
2018Y3G60DU6D is a valid date expression that refers to the date year 2018, ordinal day of year 186 (which is July 5th).
EXAMPLE 2
2018Y9M2DT2GT8HU0H30M is a valid date and time expression that refers to the date year 2018, September 2nd, 16:30.
5.4.2. Use of grouped units
Date and time representations can incorporate the grouped time scale units by applying rules from Clause 5.2 and Clause 5.3 to a date and time representation described by this document and ISO 86011:, by replacing a time scale unit component in the representations with [group].
The following representation is used for date and time representations (complete representation, reduced precision) that incorporate grouped time scale units. This representation is denoted as [groupDateTime] in this document.
[higherorderunits][group][lowerunits]
Where,

[higherorderunits] contains time scale units (and their values) that are of higher order compared to the highest order time scale unit within the group unit;

[lowerorderunits] is optional, it contains time scale units (and their values) that are of equal or lower order compared to the lowest order time scale unit within the group unit.
EXAMPLE 1
[monthE][group][yearE] is an invalid date and time representation as [monthE] has a lower order than that of [yearE].
When [lowerorderunits] is omitted, the expression refers to a unit of the grouped time scale unit.
EXAMPLE 2
[centE][group] is a valid date and time representation, expressing in units of the grouped time scale unit.
EXAMPLE 3
‘2018Y1G60DU’ represents the first 60day group of the year 2018.
EXAMPLE 4
‘2018Y2M2G14DU’ refers to the second 14day group in February of year 2018, which is in effect referring to “the second fortnight of February 2018”.
EXAMPLE 5
‘2018Y3M3G10DU’ refers to the third 10day block of March in 2018. A 10day block is a time grouping commonly used in East Asia.
EXAMPLE 6
‘T16H1GT15MU’ refers to the first quarterhour of 16:00.
When [lowerorderunits] is present, the expression refers to a date and time using the lowest time scale unit in the [lowerorderunits] expression.
Time scale components placed to the right of a grouped time scale unit behaves identically to those after a typical time scale component, such that the component to the right refers to an instance or time interval “within” the component at the left.
EXAMPLE 7
[yearE][group][dayE] is a valid date and time representation, expressing in the calendar day time scale unit. The [dayE] points to a calendar day within the expression [yearE][group].
EXAMPLE 8
[decE][group][timeE] is a valid date and time representation, expressing in the lowest order time scale units specified in [timeE], which is the clock second time scale unit. The [timeE] points to a clock time within the expression [decE][group].
EXAMPLE 9
‘2018Y3G60DU6D’ represents the sixth day of the third 60day group of the year 2018.
EXAMPLE 10
‘2018Y20GT12HU3H’ represents the third hour within the twentieth 12hour group of the year 2018.
5.4.3. Adherence to grouped unit boundaries
Time scale unit values provided in [lowerorderunits] must not fall outside of the value bounds set by the group time scale unit (the [group] expression).
EXAMPLE 1
‘2018Y1G2MU30D’ refers to the thirtieth day of the first twomonth group in year 2018. Since the first twomonth group of 2018 contains 59 days, the subsequent expression 30D falls within the same grouped time scale unit.
EXAMPLE 2
‘2018Y1G2MU60D’ refers to the sixtieth day of the first twomonth group in year 2018. It is an invalid expression as the first twomonth group of 2018 only contains 59 days, the expression 60D falls outside of the same grouped time scale unit.
5.4.4. Representation with time shift
A representation using grouped time scale units can be represented with a time shift as:
[groupDateTime][shiftE]
EXAMPLE 1
‘2018Y1G60DUZ5H’, the first 60day group of the year 2018, five hours behind UTC.
EXAMPLE 2
‘2018Y3G60DU6DZ8H’ represents the sixth day of the third 60day group of the year 2018, eight hours ahead of UTC.
5.4.5. Conversion to basic time scale units
5.4.5.1. General
When an expression referring to a grouped time scale unit has to be converted to use basic time scale units (time scale units that are defined in Clause 4), it can be converted into a time interval.
EXAMPLE
‘2018Y1G6MU’ refers to the first 6month group of year 2018. The resulting time interval is equivalent to that of the time interval expression ‘2018Y1M/2018Y6M’.
5.4.5.2. Truncation of partial units
When the duration of a grouped time scale unit does not cleanly divide the original time scale component, the duration of the last unit of the grouped time scale is only partially located within the boundaries specified by the original time scale component.
In this case, the particular grouped time scale unit refers only to the duration that is within bounds of the original time scale component. The remaining duration that are out of bounds shall be truncated.
EXAMPLE
2018Y9M4G8DU refers to the “fourth 8day grouping of September of year 2018”, but the fourth grouped unit only has 6 days within September and 2 days in October. According to the truncation rule, only the first 6 days belong to this grouped unit, and the resulting time interval is 20180925/20180930.
5.4.5.3. Spanning grouped unit boundaries
In order to express a time interval covered by the grouped unit without regard to the boundaries of the original time component, the same expression can be provided using time interval representation.
EXAMPLE
2018Y9M4G8DU, “fourth 8day grouping of September of year 2018”, the start date of the fourth grouped unit can be found as 2018Y9M25D. Therefore, the expression of 2018Y9M25D/P8D provides the full 8day duration of the unit, in the interval 2018Y9M25D/2018Y10M2.
6. Explicit representations
6.1. General
This section provides date and time representations using explicit form.
6.2. Date
6.2.1. General
The representations provided in this clause are collectively denoted as [dateE].
6.2.2. Calendar date
The complete representation of a calendar date shall be as follows.
[yearE][monthE][dayE]
EXAMPLE
‘1985Y4M12D’, calendar year 1985, April 12th.
6.2.3. Ordinal date
A complete representation of an ordinal date shall be as follows.
[yearE][dayoE]
EXAMPLE
‘1985Y102O’, calendar year 1985, ordinal day 102 of year.
6.2.4. Week date
A complete representation of a week date shall be as follows.
[yearE][weekE][daykE]
EXAMPLE
‘1985Y15W5K’, calendar year 1985, Friday of the calendar week 15.
6.3. Time of day
6.3.1. Local time of day
Representations of local time of day as defined below make no provisions to prevent ambiguities in expressions that result from discontinuities in the local time scale (e.g. daylightsaving time). When the need arises to prevent these ambiguities, the representations provided in Clause 6.6 may serve useful.
A complete representation of local time of day shall be as follows. This representation shall be denoted as [timeE].
["T"][hourE][minE][secE]
EXAMPLE
‘T23H20M50S’, a local time of day expression describing the fiftieth seconds of the twentieth minute of the twentythird clock hour.
6.3.2. Beginning of the day
The complete representation of beginning of day in explicit form shall be as follows.
T0H0M0S
Applying the rule of omitting zerovalued time scale components, it can also be represented as:
T0S
There is no representation of end of day to prevent ambiguity of the overlapping end of day and the beginning of the next day.
6.4. Time shift
A time shift is used to represent the shift of local standard time against UTC.
The complete representation of time shift in explicit form is represented as follows, and is denoted as [shiftE] within this document.
["Z"][!][""][timeE]
Where,

[“Z”] is the time shift designator;

the leading minus sign ([“”]) is only applied when the time shift expressed is behind UTC, it shall be omitted if the time shift is ahead of or equal to UTC;

the expression [timeE] indicates the actual time shift from UTC.
In accordance with Clause 6.10, zerovalued time scale components may be omitted in [timeE].
EXAMPLE 1
‘Z5H’, the time shift is 5 hours behind UTC.
EXAMPLE 2
‘Z8H’, the time shift is 8 hours ahead of UTC.
EXAMPLE 3
‘Z6H0M’, the time shift is six hours ahead of UTC; the expression ‘0M’ may be omitted in accordance with Clause 6.10.
EXAMPLE 4
‘Z8H30M10S’, the time shift is eight hours, thirty minutes and ten seconds ahead of UTC.
A single [“Z”] with the [timeE] portion empty, in accordance with the rules specified in Clause 6.10, indicates that the time shift from UTC of day is zero, and is functionally equivalent to the representation ‘Z0H0M’.
["Z"]
EXAMPLE 5
‘Z’, UTC where the time shift is zero.
EXAMPLE 6
‘Z0H0M’, UTC where the time shift is zero.
6.5. Date with shift
The complete representation for date with a time shift is as follows.
[dateE][shiftE]
EXAMPLE
‘1985Y4M12DZ5H’, calendar year 1985, April 12th with a time shift of 5 hours behind UTC.
6.6. Time of day with time shift
The complete representation for time of day with a time shift is as follows.
[timeE][shiftE]
EXAMPLE 1
‘T23H20M50SZ’, 23:20:50 at UTC of day.
EXAMPLE 2
‘T23H20M50SZ5H0M’, 23:20:50 at local time, which is 5 hours behind UTC.
EXAMPLE 3
‘T23H20M50SZ8H’, 23:20:50 at local time, which is 8 hours ahead of UTC.
6.7. Date and time of day
A time can be expressed by combining a date expression (Clause 6.2) with a time of day expression (Clause 6.3).
The date part of a date and time expression must be complete. The time may be incomplete (Clause 6.13).
The representations provided in this clause are collectively denoted as [datetimeE].
6.7.1. Date and time only
The complete representation for date and time only is as follows.
[dateE][timeE]
EXAMPLE
‘1985Y4M12DT23H20M30S’, calendar year 1985, April 12th, 23:20:30.
6.7.2. Date and time with shift
The complete representation for date with time and a time shift is as follows.
[dateE][timeE][shiftE]
EXAMPLE
‘1985Y4M12DT23H20M30SZ8H’, calendar year 1985, April 12th, 23:20:30, 8 hours ahead of UTC.
6.8. Decade
The complete representation for decade is as follows.
[decE]
EXAMPLE
‘1880’, the decade 1880s, spanning years from 1880 to 1889.
6.9. Century
The complete representation for century is as follows.
[centE]
EXAMPLE
‘1300’, the century 1300s, spanning years from 1300 to 1399.
6.10. Omission of zero valued components
Time scale components within an explicit form that has a value of 0 may be omitted entirely with its corresponding designator, except when the omission of it affects the indication of precision.
In the representations given in this clause, if a time scale component of a higher order (compared to the lowest order component specified in the representation) is omitted, it is assumed to have the value “0” as long as the time scale component accepts the value “0” (ISO 86011:, Clause 4.3).
EXAMPLE 1
‘1985Y4M15DT15H0M10S’ and ‘1985Y4M15DT15H10S’ can be both used to express the time 3:00:10 p.m. on April 15th, 1985 in the Gregorian calendar.
EXAMPLE 2
‘1988Y3M1DT2H0M0S’ and ‘1988Y3M1DT2H’ are unequal representations where the former expression has seconds precision, and the latter expression has hour precision.
EXAMPLE 3
‘2018Y8M8DT30M0SZ’: indicates the date 8th August 2018 at time 00:30:00 in UTC time of day Since the “hour” component is omitted and “seconds” included, the hour is assumed to be zero, and the expression has seconds precision. This is equivalent to the expression ‘2018Y08M08DT30M0SZ’ in which zero padding is applied to calendar month and calendar day.
6.11. Indication of precision
The lowest denoted time scale component in a date and time representation indicates the precision level of the representation.
EXAMPLE 1
‘1985Y4M’ has calendar month precision.
EXAMPLE 2
‘1985Y4M12DT2H’ has clock hour precision.
EXAMPLE 3
‘1985Y4M12DT30M’ has clock minute precision, where the clock hour time scale component is a zerovalued omission.
6.12. Decimal fractions for time
A decimal fraction of hour, minute or second may be included in an expression in accordance with ISO 86011:, Clause 5.2.1.4.
EXAMPLE 1
‘2018Y8M8DT0,5H’: indicates the date 8th August 2018 at time 00:30 with minutes precision.
EXAMPLE 2
‘2018Y8M8DT10H30.5M’: indicates the date 8th August 2018 at time 10:30:30 with seconds precision.
EXAMPLE 3
‘2018Y8M8DT10H30M15,3S’: indicates the date 8th August 2018 at time 10:30:15 plus 300ms with subsecond precision.
6.13. Representations other than complete
Any of the representations given in this clause may be modified for reduced precision (Clause 6.11) and decimal representation (Clause 6.12).
EXAMPLE 1
‘2018Y8M’: indicates the date August 2018 with calendar month precision.
EXAMPLE 2
‘2018Y8M8DT30M’: indicates the date 8th August 2018 at time 00:30 with minute precision. Since the “hour” component is omitted, it is assumed to be zero because it is of a higher order than the lowest order component specified in the representation (here, “minutes). The omitted “`second” component does not form part of the representation because it is of a lower order than the lowest order component.
6.14. Time interval
6.14.1. General
A time interval shall be expressed by a start and an end date. A solidus [“/”] is used as a separator to separate the two start and end dates.
The complete representation of a time interval is defined as follows.
[datetimeE]["/"][datetimeE]
EXAMPLE
‘1985Y4M12DT23H20M50S/1985Y6M25DT10H30M0S’, time interval beginning at 20 minutes and 50 seconds past 23 hours on 12 April 1985 local time of day and ending at 30 minutes past 10 hours on 25 June 1985 local time of day.
6.14.2. Duration substitution
Providing a duration as an alternative to either a start or end date is acceptable, given the start and end dates can be inferred from the given duration of the time interval.
EXAMPLE 1
‘1985Y4M12DT23H20M50S/P3D’
EXAMPLE 2
‘P3D/1985Y4M12DT23H20M50S’
6.14.3. Time scale component order
For expression of a time interval by a start and an end, higher order time scale components may be omitted from the “end of time interval”, provided that the resulting expression is unambiguous. In this case the omitted higher order components from the “start of time interval” expression apply.
EXAMPLE
‘2018Y1M15D/2M20D’ represents ‘2018Y1M15D/2018Y2M20D’ as the expression ‘2M20D’ unambiguously refers to the calendar month and calendar day components, and the higher order components can be inherited from the start date expression.
6.14.4. Time shift indication
Representations for time zones and UTC included with the component preceding the separator shall be assumed to apply to the component following the separator, unless a corresponding alternative is included.
EXAMPLE
‘2018Y1M15DZ5Y0M/2018Y2M20D’ is equivalent to ‘2018Y1M15DZ5Y0M/2018Y2M20DZ5Y0M’ as the ‘Z5H0M’ time shift also applies to the expression after the separator.
7. Explicit duration
7.1. General
Duration can be expressed by a combination of time scale units in explicit form — years, months, weeks, days, hours, minutes, and seconds.
These time scale components are specified in Clause 4, and are used to specify positive duration.
7.2. Durational units
Time scale unit components are used to compose a duration expression, and are defined as “durational units”.
The following time scale components can be combined to form a representation denoted as [durationUnits] for the expression of duration.
[yearE][monthE][weekE][dayE]["T"][hourE][minuteE][secondE]
Where,

each time scale component acting as a durational unit (such as [monthE]) may be omitted;

the time designator symbol [“T”] is used to separate the time scale components relating to the clock from those of the calendar.
Within [durationUnits], time scale components of higher order shall be expressed before those of lower order.
7.3. Representations
7.3.1. General
The following representations are both considered complete representations of duration.
7.3.2. Composite representation
The composite representation of a duration, fully accepting expressions of the duration representation given in ISO 86011:, Clause 5.2.3, is given as follows.
[!][""]["P"][durationUnits]
Where,

[durationUnits] contains time scale components for expressing positive duration.
EXAMPLE 1
‘P3D’, duration of three days.
EXAMPLE 2
‘P3W2D’, duration of three weeks and two days, which is 23 days, as equivalent to the expression of ‘P23D’.
EXAMPLE 3
‘P180Y800D’, duration of onehundredandeighty years and eighthundred days.
NOTE The exact duration for some time scale components can only be known when placed on the actual time scale.
7.3.3. Precedence representation
The precedence representation of a duration is used for specifying author intent in the evaluation order of time scale components within a duration.
The representation of calendar duration time scale components (denoted as [calendarD]) is provided as follows.
["P"][calendarDU]
Where,

[calendarDU] is one of [yearE], [monthE], [weekE], [dayE].
EXAMPLE 1
P3D describes a duration of three days, in accordance with [calendarD].
The representation of clock duration time scale components (denoted as [clockD]) is provided as follows.
["P"]["T"][clockDU]
Where,

[clockDU] is one of [hourE], [minuteE], [secondE].
EXAMPLE 2
PT8H describes a duration of eight hours, in accordance with [clockD].
The duration precedence representation is described as follows, denoted as [durationP].
[!][""][durC1][durC2]...[durCn]
Where,

[durCi] is either [calendarD] or [clockD];

the order of the [durCi] components is used to determine the evaluation precedence order of the duration statement [durationP].
EXAMPLE 3
P1YP3MP2D describes a duration of one year, three months and two days, to be evaluated in the order as described.
EXAMPLE 4
P2DP3MP1Y describes a duration of two days, three months and one year, to be evaluated in the order as described.
EXAMPLE 5
PT10HP2DP3MP1Y describes a duration of ten hours, two days, three months and one year, to be evaluated in the order as described.
7.4. Negative duration
A duration with a negative value represents a duration in the reverse direction of the proceeding time scale.
EXAMPLE 1
P20Y3M describes a negative duration of twenty years and three months ago.
EXAMPLE 2
P2DP3MP1Y describes a negative duration of two days, three months and one year, to be evaluated in the order as described.
7.5. Fractional duration
A duration representation can be modified to accept a fractional value in place of any [i] specified in a durational time scale component.
7.6. Exact duration
7.6.1. General
This clause describes methods to resolve exact duration in face of ambiguities.
7.6.2. Contextdependent duration
The exact duration of some time scale units can only be known when placed on the actual time scale.
EXAMPLE 1
‘P1Y’ duration could be 365 or 366 calendar days depending on whether the year is a leap year.
EXAMPLE 2
‘P3M’ duration could be 90, 91, 92 days depending on the actual calendar months and calendar year.
EXAMPLE 3
‘PT1M’ duration is normally 60 seconds, but when the minute is the last minute of the year, it could be 59, 60 or 61 seconds long depending on whether a leap second is applied.
EXAMPLE 4
‘P1Y2M15DT12H30M’, duration of 1 year, 2 months, 15 days, 12 hours and 30 minutes. The actual duration of the involved calendar months can only be known when the duration is placed on an actual start date.
7.6.3. Speculative duration
The exact duration of certain time scale unit may only be known after an event occurs.
There is no universal rule to calculate leap seconds in advance, since the decision to insert a leap second is driven by a number of dynamic factors and only known when announced by the BIPM.
Specifically, the exact duration of the last clock minute of a calendar year can only be known after it is announced by the BIPM, whether a leap second has or will occur (in UTC). This event is described in this document to occur at the “leap second horizon date” for a calendar year.
The exact duration of the last clock minute in a calendar year is one of the following duration:

when there is a positive leap second, 61 clock seconds;

when there is no leap second, 60 clock seconds; and

when there is a negative leap second, 59 clock seconds.
For the accuracy of general purposes, it is acceptable to assume the last clock minute always contains 60 clock seconds, just like any other clock minute.
For cases where durational accuracy at the clock second level is of importance, the following steps shall be taken:

When calculating exact duration prior to the leap second horizon date of a specific calendar year involved, the last clock minute is assumed to have no leap second, such that 59 is always the last second of the year;

When calculating exact duration after the leap second horizon date of a specific calendar year involved, the last clock minute shall reflect the actual duration.
EXAMPLE 1
‘P3000Y12M31DT23H59M’ is considered to have a duration of 60 clock seconds, as the calendar year 3000’s leap second horizon date has not yet occurred.
EXAMPLE 2
‘P2016Y12M31DT23H59M’ is considered to have a duration of 61 clock seconds, since the leap second horizon date has already occurred, and it is known that a positive leap second assigned to the calendar year 2016.
8. Evaluation of date and time with duration
8.1. General
A date and time representation is modified by a duration in many cases, including the calculation for:

time intervals when given duration as a start or end;

boundaries of grouped time scale units (Clause 5);

conversion between of UTC of day and local time of day via time shifts; and

occurrences of recurring time intervals.
This clause provides methods to calculate a consistent result date and time, given an origin date and time (“origin”) and a duration time scale component (duration) to apply.
Modification of a date and time representation with a duration is described using the following representation, called a “date time formula”.
resolve(date, duration)
or
date + duration
EXAMPLE
2018Y9M10D + P1D is a date time formula.
8.2. Prerequisite mechanisms
8.2.1. Carryover of overflow in time scale components
An “overflow” of a date and time expression is defined as assigning a value exceeding the maximum value accepted by the time scale component.
EXAMPLE 1
An increase of P1M (duration) to 2018Y12M (date) will result in the expression 2018Y13M, where the month component is overflowed with value 13.
An overflow is considered resolved once the overflowed time scale unit has transferred its excess to the immediate higher order time scale component.
EXAMPLE 2
The overflowed expression 2018Y13M can be resolved to 2019Y1M.
An overflow can cause multiple carryovers when the overflow not only causes the immediate higher order time scale component to overflow, but also subsequent higher order components.
EXAMPLE 3
The overflowed expression 2018Y12M366D can be resolved to 2018Y24M1D (which still contains an overflow), which can be resolved to 2019Y12M1D (where there is no more overflow).
8.2.2. Truncation at time scale component boundaries
A modification made to a higher order time scale component may cause the value of a lower order time scale component to go beyond its value boundaries. This condition is described as “out of bounds” of a date and time expression.
This situation occurs when a modification is made to the values of certain time scale components, because a lower order component always has its maximum value bound by its immediate higher order component:

clock minute (clock second value of 60 is only valid for a leap second);

calendar month (calendar day values 29, 30, 31 are invalid for some months); and

calendar year (ordinal day value of 366 and calendar month/day combination of February 29th is only valid for a leap year).
EXAMPLE 1
An increase of P1M (duration) to 2018Y1M31D (date) will result in the expression 2018Y2M31D, which is an invalid date representation as the calendar day value of 31 has exceeded the boundary of its immediate higher order component, the month 2 (February).
EXAMPLE 2
An increase of P1Y (duration) to 2016Y12M31DT23H59M60S (date) will result in the expression 2017Y12M31DT23H59M60S, which is an invalid date representation as the clock second value of 60 has exceeded the boundary of its immediate higher order component, the clock minute with its last second at 59.
An out of bounds situation is considered resolved once the excess value is truncated at the violating (lower order) time scale component.
EXAMPLE 3
The out of bounds expression 2019Y2M29D`" can be truncated to `2019Y2M28D.
EXAMPLE 4
The out of bounds expression 2020Y366O`" can be truncated to `2020Y365O.
8.3. Simple duration
A simple duration is a duration expression with only a single time scale component.
Evaluation of a date time formula that contains a simple duration is to directly apply the durational unit to the corresponding time scale component of the date and time representation and applying carryover.
The steps are as follows:

Take the value of the time scale component in the simple duration, directly modify the value of the corresponding time scale component in the date and time representation.

In the resulting date and time representation, start from the lowest order overflowed time scale component, perform carryover until there is no more overflow in the representation.

If any time scale components have become invalid, apply truncation to them.

The resulting date and time representation is complete.
EXAMPLE
Calculation of 2022Y2M28D + P3D:

Direct modification of date and time representation, obtains 2022Y2M31D.

Apply carryover to overflowed components, obtains 2022Y3M02D.
8.4. Composite duration
The method of evaluating of a date time formula with a composite duration (Clause 7.3.2) is to directly apply the durational units to the date and time representation without truncation, and only applying carryover at the end.
The steps are as follows:

For all values of time scale components in the composite duration, directly modify the values of the corresponding time scale components in the date and time representation.

In the resulting date and time representation, start from the lowest order overflowed time scale component, perform carryover on all overflowed time scale components, until there is no more overflow in the representation.

If any time scale components have become invalid, apply truncation to them.

The resulting date and time representation is complete.
EXAMPLE
Calculation of 2022Y2M30D + P1Y3M2D:

Direct modification of date and time representation, obtains 2023Y5M32D.

Apply carryover to overflowed components, obtains 2023Y6M31D.

The resulting representation is 2023Y6M31D.
8.5. Precedence duration
The method of evaluating of a date time formula with a precedence duration (Clause 7.3.3) is to apply the durational units one by one to the date and time representation with truncation and carryover at every step.
The steps are as follows:

Starting at the left side of the precedence duration expression, process every durational unit one by one as follows:

Use the durational unit (which only contains one time scale component), to modify the corresponding time scale component (the “target component”) in the date and time representation.

If the target component has overflowed in the previous step, perform carryover (to higher order time scale components), until there is no more overflow in the representation.

If any time scale components of lower order than the target component have become invalid, apply truncation to them.


Once all durational units have been processed, the resulting date and time representation is complete.
EXAMPLE 1
Calculation of 2022Y2M29D + P1YP3MP2D:

Process the first durational unit: (2022Y2M29D + P1Y) + P3MP2D.

Apply the first durational unit to the date and time representation: 2023Y2M29D + P3MP2D.

No carryover is necessary since there is no overflow.

Since 29D is of lower order than the target component (calendar year), the representation is truncated: 2023Y2M28D + P3MP2D.

Process the second durational unit: (2023Y2M28D + P3M) + P2D.

Apply the second durational unit to the date and time representation: 2023Y5M28D + P2D.

No carryover is necessary since there is no overflow.

No component of lower order than the target component is invalid, hence truncation is not necessary.

Process the third durational unit: 2023Y5M28D + P2D.

Apply the third durational unit to the date and time representation: 2023Y5M31D.

No carryover is necessary since there is no overflow.

No component of lower order than the target component is invalid, hence truncation is not necessary.

The resulting date and time representation is 2023Y5M31D.
EXAMPLE 2
Calculation of 2022Y2M29D + P2DP3MP1Y:

Process the first durational unit: (2022Y2M29D + P2D) + P3MP1Y.

Apply the first durational unit to the date and time representation: 2022Y2M31D + P3MP1Y.

Carryover is necessary since there is the target component has overflowed: 2022Y3M2D + P3MP1Y.

No component of lower order than the target component is invalid, hence truncation is not necessary.

Process the second durational unit: (2022Y3M2D + P3M) + P1Y.

Apply the second durational unit to the date and time representation: 2022Y6M2D + P1Y.

No carryover is necessary since there is no overflow.

No component of lower order than the target component is invalid, hence truncation is not necessary.

Process the third durational unit: 2022Y6M2D + P1Y.

Apply the third durational unit to the date and time representation: 2023Y6M2D.

No carryover is necessary since there is no overflow.

No component of lower order than the target component is invalid, hence truncation is not necessary.

The resulting date and time representation is P1Y.
8.6. Involving fractional duration
When fractional duration (Clause 7.5) is applied to contextdependent durational units (Clause 7.6.2), it is necessary to resolve the fractional duration in context.
EXAMPLE 1
The expression P0.5M (“half a month”) is ambiguous because the exact duration of a calendar month depends on its context, and that the context for which P0.5M is anchored to is unclear.
The duration of a fractional, contextdependent, durational unit can be obtained by first calculating a single unit of the durational unit in context, such that, the exact duration for the durational unit in whole (e.g. “P1M”) becomes known. Once the exact duration of a single unit is known, the duration of the fractional unit can be calculated.
date + fracdur =
duration(date + unit(fracdur), date) × value(fracdur) + date
Where,

unit(fracdur) is the value of a single unit used in the duration fracdur;

value(fracdur) is the fractional value used with the duration fracdur;

duration(date1, date2) is a function to calculate the duration between two dates or times, such as Clause 8.4 or Clause 8.5.
Given that “date + unit(fracdur)” can be calculated, this method always produces a consistent value.
EXAMPLE 2
Given the expression: 20180123 + P0.5M:

It is rephrased as duration(20180123 + P1M, 20180123) × 0.5 + 20180123.

It is reduced to duration(20180223, 20180123).

Then P31D × 0.5 + 20180123.

Then P15.5D + 20180123.

Since P15.5D is an exact duration (duration of calendar day is known), P15.5D + 20180123`" is resolvable and gives the final result `20180207T12:00:00.
8.7. Involving speculative duration
As described in Clause 7.6.3, there is no universal rule to calculate leap seconds in advance, since the decision to insert a leap second is driven by a number of dynamic factors and only known when announced by the BIPM.
The rules specified in Clause 7.6.3 are used to evaluate a date time formula that involves leap seconds.
EXAMPLE 1
This example applies identically with or without a leap second. Given the expression: 20181231T23:59:59 + PT1M:

Apply the durational unit clock minute directly to the representation: 20181231T23:60:59

Since 59 is the last clock minute, treat the overflow with carryover: 20181231T24:00:59

Since 23 is the last clock hour, treat the overflow with carryover: 20181232T00:00:59

Since 31 is the last calendar day of year, treat the overflow with carryover: 20181301T00:00:59

Since 13 is the last calendar month, treat the overflow with carryover: 20190101T00:00:59

The resulting expression is 20190101T00:00:59.
EXAMPLE 2
Given the expression containing a leap second: 20161231T23:59:60 + PT1M:

Apply the durational unit clock minute directly to the representation: 20161231T23:60:60

Since 59 is the last clock minute, treat the overflow with carryover: 20161231T24:00:60

Since 23 is the last clock hour, treat the overflow with carryover: 20161232T00:00:60

Since 31 is the last calendar day of year, treat the overflow with carryover: 20161301T00:00:60

Since 13 is the last calendar month, treat the overflow with carryover: 20170101T00:00:60

The clock second 60 is out of bounds, it is truncated to the maximum value: 20170101T00:00:59

The resulting expression is 20170101T00:00:59.
EXAMPLE 3
Given the expression containing a leap second: 20161231T23:59:59 + PT1S:

Apply the durational unit clock second directly to the representation: 20161231T23:59:60

The resulting expression is 20161231T23:59:60.
Bibliography
[1] ISO/IEC 646, Information technology — ISO 7bit coded character set for information interchange
[2] ISO 8601:2004, Data elements and interchange formats — Information interchange — Representation of dates and times
[3] ISO 86012:—, Date and time — Representation for information interchange — Part 2: Extensions
[4] IETF RFC 5545, Internet Calendaring and Scheduling Core Object Specification (iCalendar)
[5] IETF RFC 6350, vCard Format Specification