ISO 8601:1988 Date/Time Representations
Gary Houston
1993-01-31
Introduction
This document describes the ISO standard for numerical date/time
interchange formats, 8601:1988, which supersedes the ISO
standards: 2014, 2015, 2711, 3307 and 4031.
Note that this is only a description of the standard, not
the standard itself (for which the copyright is held by the ISO). In
particular note that section numbers do not agree with those of the
standard. This document may be freely redistributed, but the text
may not be changed in any way unless the name of the author is replaced by
the name of the person controlling the modification. The author does
not accept liability for errors, misrepresentations or omissions in the
description of the standard. In situations of life and death it may be
prudent to obtain the official document.
The standard defines formats for numerical representation of dates,
times and date/time combinations. Local time and Coordinated
Universal Time (UTC) are supported. Dates are for the Gregorian
calendar (introduced in 1582), and can be given in
year-month-day, year-week-day or year-day formats. Times are
given in 24hr format. All date and time formats are represented
with the largest units given first, i.e., from left to right the
ranking is year, month, week, day, hour, minute, second. Any
particular date/time format is a subset of these possible values,
and the standard lists various permissible subsets. The hyphen
character is sometimes used to represent missing components,
thus avoiding ambiguity. The standard allows these hyphens to
be omitted by mutual agreement in a data interchange, if
ambiguity can be avoided. Formats are also given for periods of time,
either by listing the start and end dates or as a given length of time.
A calendar date is identified by a given day in a given month
in a given year. A leap year is a year whose
number is divisible by four an integral number of times, except in
the case of centennial years in which it is divisible by four hundred
an integral number of times. If a year is not a leap year it is a common
year. Common years have 365 days while leap years have 366.
An ordinal date is identified by a given day
in a given year. A week is identified by its number in a given
year. A week begins with a Monday, and the first week of a
year is the one which includes the first Thursday, or equivalently
the one which includes January 4. Midnight may be expressed as
either 00:00:00 or 24:00:00.
Unless otherwise stated, all values are fixed width,
with leading zeros used when
necessary to pad out a value. Many formats can be given in either
a "basic format" or an "extended format", where the extended format
has additional separation characters between values. Characters are
taken from ISO 646. Some formats require alphabetic letters, which
should be upper case, although lower case may be used if upper case
is not available.
In this paper, the date/time 14 February 1993, 13:10:30 (ten minutes
and thirty seconds past one pm) is used to demonstrate formats. The
ordinal day number is 045 and the week number is 06. The day number
within the week is 7.
Date Formats
Calendar Date Formats
The following complete, abbreviated or truncated formats are permissible:
- 19930214 or 1993-02-14 (complete representation)
- 1993-02 (reduced precision)
- 1993
- 19
- 930214 or 93-02-14 (truncated, current century assumed)
- -9302 or -93-02
- -93
- --0214 or --02-14
- --02
- ---14
Ordinal Date Formats
The day number within a given year can be expressed as:
- 1993045 or 1993-045 (complete representation)
- 93045 or 93-045
- -045
Week/Day Formats
Dates with a given week number may be expressed as:
- 1993W067 or 1993-W06-7 (complete representation)
- 1993W06 or 1993-W06
- 93W067 or 93-W06-7
- 93W06 or 93-W06
- -3W067 or -3-W06-7
- -W067 or -W06-7
- -W06
- -W-7 (day of current week)
- ---7 (day of any week)
Time formats
Local Time of Day
Local time of day may be expressed as:
- 131030 or 13:10:30 (complete representation)
- 1310 or 13:10
- 13
- -1030 or -10:30
- -10
- --30
Note that when the basic format (e.g,. 1310) is being used, and the
context does not imply a time value only, the time should be
preceded by a "T" to avoid confusion with date values. In this
case the rules for combined date/time formats should be followed,
which forbid replacing leading time values with hyphens.
Fractional Local Time of Day
Decimal fractions may be included with an hour, minute or second.
The decimal sign should be either a comma (preferred) or a full stop.
If the value is less than one then the decimal sign should be
preceded by a zero. The number of decimal places is set
depending on the application.
The following formats are permitted (given one decimal place):
- 131030,7 or 13:10:30,7
- 1310,5 or 13:10,5
- 13,2
- -1030,7 or -10:30,7
- -10,5
- --30,7
Coordinated Universal Time (UTC)
A time can be expressed in UTC by appending the symbol "Z" without
spaces to any of the local time or fractional local time formats given above.
Difference between Local and UTC Times
The relationship of a local time to UTC can be expressed by appending
a time zone indicator without spaces to the right-hand side of the
local time representation, which must include hours.
E.g., the indicator for New Zealand summer time (13 hours ahead of UTC),
can be expressed as:
Omitting the minutes implies a lower precision for the time zone value,
and is independent of the precision of the time value to which the
zone is attached. Time zones behind UTC use the – sign. The standard
implies (but does not state explicitly) that the extended zone format
(13:00) is used with extended format times, and the basic zone format
(1300) with basic format times.
Combined Date/Time Formats
The symbol "T" is used to separate the date and time parts of the
combined representation. This may be omitted by mutual consent
of those interchanging data, if ambiguity can be avoided.
The complete representation is as follows:
- 19930214T131030 or 1993-02-14T13:10:30
The date and/or time components independently obey the rules already
given in the sections above, with the restrictions:
- The date format should not be truncated on the right (i.e.,
represented with lower precision) and the
time format should not be truncated on the left (i.e., no
leading hyphens).
- When the date format is truncated on the left, the leading
hyphens may be omitted.
Periods of Time
The subsections below give the complete basic representations for each
of four methods of specifying periods of time. Where two time
values are required, they are separated with a solidus "/",
although the standard states that a double hyphen is used
in "certain application areas". The dates are given in calendar
form, but ordinal or week/day may alternatively be used, and
basic representation can be replaced by the appropriate extended
representation. Likewise, valid reduced precision, truncated or
decimal formats may be used.
Specific Start and Specific End
- 19930214T131030/19930214T131031 (a very short period)
Note that if the higher order components of the second period
are omitted, the corresponding values from the first period
are used. Likewise, if a timezone is supplied for the
first period but not the second, it is assumed to be
used for both.
Periods of Time, no Specific Start or End
This is the only format for which variable width values are used.
The value starts with "P", and is followed by a list of periods,
each appended by a single letter designator: "Y" for years, "M"
for months, "D" for days, "W" for weeks, "H" for hours, "M" for
minutes, and "S" for seconds. Time components must be preceded by
the "T" character. Examples:
- P18Y9M4DT11H9M8S (18 years, 9 months, 4 days, 11 hours, 9 minutes
and 8 seconds.
- P2W (2 weeks).
No extended representation is defined for this format.
Alternatively, if required, a period of time may be expressed
using the format specified for points in time, provided the
values do not exceed 12 months, 30 days, 24 hours, 60 minutes, and
60 seconds. Weeks should not be used.
Period with Specific Start
- 19930214T131030/P18Y9M4DT11H9M8S
Period with Specific End
- P18Y9M4DT11H9M8S/19930214T131030
Thanks to the University of Erlangen where this document was archived in sgml format.