ISO 8601

From Infogalactic: the planetary knowledge core
(Redirected from DIN ISO 8601:2006-09)
Jump to: navigation, search

ISO 8601 Data elements and interchange formats – Information interchange – Representation of dates and times is an international standard covering the exchange of date and time-related data. It was issued by the International Organization for Standardization (ISO) and was first published in 1988. The purpose of this standard is to provide an unambiguous and well-defined method of representing dates and times, so as to avoid misinterpretation of numeric representations of dates and times, particularly when data are transferred between countries with different conventions for writing numeric dates and times.

In general, ISO 8601 applies to representations and formats of dates in the Gregorian (and potentially proleptic Gregorian) calendar, times based on the 24-hour timekeeping system (including optional time zone information), time intervals and combinations thereof.[1] The standard does not assign any specific meaning to elements of the date/time to be represented; the meaning will depend on the context of its use. In addition, dates and times to be represented cannot include words with no specified numerical meaning in the standard (e.g., names of years in the Chinese calendar) or that do not use characters (e.g., images, sounds).[1]

In representations for interchange, dates and times are arranged so the largest temporal term (the year) is placed to the left and each successively smaller term is placed to the right of the previous term. Representations must be written in a combination of Arabic numerals and certain characters (such as "-", "W", and "Z") that are given specific meanings within the standard; The implication is that some commonplace ways of writing parts of dates, such as "January" or "Thursday", are not allowed in interchange representations.

Date and time (current at page generation)
expressed according to ISO 8601:
Date: 2024-11-05
Combined date and time in UTC: 2024-11-05T12:55:35+00:00
2024-11-05T12:55:35Z
20241105T125535Z
Week: 2024-W45
Date with week number: 2024-W45-2
Ordinal date: 2024-310

History

The first edition of the ISO 8601 standard was published as ISO 8601:1988 in 1988. It unified and replaced a number of older ISO standards on various aspects of date and time notation: ISO 2014, ISO 2015, ISO 2711, ISO 3307, and ISO 4031.[2] It has been superseded by a second edition ISO 8601:2000 in 2000 and by the current third edition ISO 8601:2004 published on 3 December 2004. ISO 8601 was prepared by,[3] and is under the direct responsibility of, ISO Technical Committee TC 154.[4]

Lua error in package.lua at line 80: module 'strict' not found. ISO 2014, though superseded, is the standard that originally introduced the all-numeric date notation in most-to-least-significant order [YYYY]-[MM]-[DD]. The ISO week numbering system was introduced in ISO 2015, and the identification of days by ordinal dates was originally defined in ISO 2711.

General principles

  • Date and time values are ordered from the largest to smallest unit of time: year, month (or week), day, hour, minute, second, and fraction of second. The lexicographical order of the representation thus corresponds to chronological order, except for date representations involving negative years. This allows dates to be naturally sorted by, for example, file systems.
  • Each date and time value has a fixed number of digits that must be padded with leading zeros.
  • Representations can be done in one of two formats – a basic format with a minimal number of separators or an extended format with separators added to enhance human readability.[5] The standard notes that "The basic format should be avoided in plain text."[6] The separator used between date values (year, month, week, and day) is the hyphen, while the colon is used as the separator between time values (hours, minutes, and seconds). For example, the 6th day of the 1st month of the year 2009 may be written as "2009-01-06" in the extended format or simply as "20090106" in the basic format without ambiguity.
  • For reduced precision,[7] any number of values may be dropped from any of the date and time representations, but in the order from the least to the most significant. For example, "2004-05" is a valid ISO 8601 date, which indicates May (the fifth month) 2004. This format will never represent the 5th day of an unspecified month in 2004, nor will it represent a time-span extending from 2004 into 2005.
  • If necessary for a particular application, the standard supports the addition of a decimal fraction to the smallest time value in the representation.

Dates

November 2024
Week Mon Tue Wed Thu Fri Sat Sun
W44 28 29 30 31 01 02 03
W45 04 05 06 07 08 09 10
W46 11 12 13 14 15 16 17
W47 18 19 20 21 22 23 24
W48 25 26 27 28 29 30 01

The standard uses the Gregorian calendar, which serves as an international standard for civil use.[8]

ISO 8601 fixes a reference calendar date to the Gregorian calendar of 20 May 1875 as the date the Convention du Mètre (Metre Convention) was signed in Paris. However, ISO calendar dates before the Convention are still compatible with the Gregorian calendar all the way back to the official introduction of the Gregorian calendar on 1582-10-15. Earlier dates, in the proleptic Gregorian calendar, may be used by mutual agreement of the partners exchanging information. The standard states that every date must be consecutive, so usage of the Julian calendar would be contrary to the standard (because at the switchover date, the dates would not be consecutive).

Years

YYYY
±YYYYY

ISO 8601 prescribes, as a minimum, a four-digit year [YYYY] to avoid the year 2000 problem. It therefore represents years from 0000 to 9999, year 0000 being equal to 1 BC and all others AD. However, years prior to 1583 are not automatically allowed by the standard. Instead "values in the range [0000] through [1582] shall only be used by mutual agreement of the partners in information interchange."[9]

To represent years before 0000 or after 9999, the standard also permits the expansion of the year representation but only by prior agreement between the sender and the receiver.[10] An expanded year representation [±YYYYY] must have an agreed-upon number of extra year digits beyond the four-digit minimum, and it must be prefixed with a + or − sign[11] instead of the more common AD/BC (or BCE/CE) notation; by convention 1 BC is labelled +0000, 2 BC is labeled -0001, and so on.[12]

Calendar dates

YYYY-MM-DD or YYYYMMDD
YYYY-MM (but not YYYYMM)

Calendar date representations are in the form shown in the box to the right. [YYYY] indicates a four-digit year, 0000 through 9999. [MM] indicates a two-digit month of the year, 01 through 12. [DD] indicates a two-digit day of that month, 01 through 31. For example, "5 April 1981" may be represented as either "1981-04-05"[5] in the extended format or "19810405" in the basic format.

The standard also allows for calendar dates to be written with reduced precision. For example, one may write "1981-04" to mean "1981 April", and one may simply write "1981" to refer to that year or "19" to refer to the century from 1900 to 1999 inclusive. Although the standard allows both the YYYY-MM-DD and YYYYMMDD formats for complete calendar date representations, if the day [DD] is omitted then only the YYYY-MM format is allowed. By disallowing dates of the form YYYYMM, the standard avoids confusion with the truncated representation YYMMDD (still often used).

Week dates

<templatestyles src="Module:Hatnote/styles.css"></templatestyles>

YYYY-Www or YYYYWww
YYYY-Www-D or YYYYWwwD

Week date representations are in the format as shown in the box to the right. [YYYY] indicates the ISO week-numbering year which is slightly different from the traditional Gregorian calendar year (see below). [Www] is the week number prefixed by the letter W, from W01 through W53. [D] is the weekday number, from 1 through 7, beginning with Monday and ending with Sunday.

There are mutually equivalent descriptions of week 01:

  • the week with the year's first Thursday in it (the formal ISO definition),
  • the week with 4 January in it,
  • the first week with the majority (four or more) of its days in the starting year, and
  • the week starting with the Monday in the period 29 December – 4 January.

If 1 January is on a Monday, Tuesday, Wednesday or Thursday, it is in week 01. If 1 January is on a Friday, Saturday or Sunday, it is in week 52 or 53 of the previous year (there is no week 00). 28 December is always in the last week of its year.

The week number can be described by counting the Thursdays: week 12 contains the 12th Thursday of the year.

The ISO week-numbering year starts at the first day (Monday) of week 01 and ends at the Sunday before the new ISO year (hence without overlap or gap). It consists of 52 or 53 full weeks. The ISO week-numbering year number deviates from the number of the traditional Gregorian calendar year on a Friday, Saturday, and Sunday, or a Saturday and Sunday, or just a Sunday, at the start of the traditional Gregorian calendar year (which are at the end of the previous ISO week-numbering year) and a Monday, Tuesday and Wednesday, or a Monday and Tuesday, or just a Monday, at the end of the traditional Gregorian calendar year (which are in week 01 of the next ISO week-numbering year). For Thursdays, the ISO week-numbering year number is always equal to the traditional Gregorian calendar year number.

Examples:

  • Monday 29 December 2008 is written "2009-W01-1"
  • Sunday 3 January 2010 is written "2009-W53-7"

Ordinal dates

YYYY-DDD or YYYYDDD

An ordinal date is a simple form for occasions when the arbitrary nature of week and month definitions are more of an impediment than an aid, for instance, when comparing dates from different calendars. As represented above, [YYYY] indicates a year. [DDD] is the day of that year, from 001 through 365 (366 in leap years). For example, "1981-04-05" is also "1981-095".

This format is used with simple hardware systems that have a need for a date system, but where including full calendar calculation software may be a significant nuisance. This system is sometimes referred to as "Julian Date", but this can cause confusion with the astronomical Julian day, a sequential count of the number of days since day 0 beginning 1 January 4713 BC Greenwich noon, Julian proleptic calendar (or noon on ISO date -4713-11-24 which uses the Gregorian proleptic calendar with a year [0000]).

Times

hh:mm:ss.sss or hhmmss.sss
hh:mm:ss or hhmmss
hh:mm or hhmm
hh

ISO 8601 uses the 24-hour clock system. The basic format is [hh][mm][ss] and the extended format is [hh]:[mm]:[ss].

  • [hh] refers to a zero-padded hour between 00 and 24 (where 24 is only used to denote midnight at the end of a calendar day).
  • [mm] refers to a zero-padded minute between 00 and 59.
  • [ss] refers to a zero-padded second between 00 and 60 (where 60 is only used to denote an added leap second).

So a time might appear as either "134730" in the basic format or "13:47:30" in the extended format.

It is also acceptable to omit lower order time elements for reduced precision:[7] [hh]:[mm], [hh][mm] and [hh] are all used. (The use of [hh] alone is considered basic format.[13])

Midnight is a special case and may be referred to as either "00:00" or "24:00". The notation "00:00" is used at the beginning of a calendar day and is the more frequently used. At the end of a day use "24:00". "2007-04-05T24:00" is the same instant as "2007-04-06T00:00" (see Combined date and time representations below).

Decimal fractions may be added to any of the three time elements. However, a fraction may only be added to the lowest order time element in the representation. A decimal mark, either a comma or a dot (without any preference as stated in resolution 10 of the 22nd General Conference CGPM in 2003,[14] but with a preference for a comma according to ISO 8601:2004)[15] is used as a separator between the time element and its fraction. To denote "14 hours, 30 and one half minutes", do not include a seconds figure. Represent it as "14:30,5", "1430,5", "14:30.5", or "1430.5". There is no limit on the number of decimal places for the decimal fraction. However, the number of decimal places needs to be agreed to by the communicating parties.

Time zone designators

<time>Z
<time>±hh:mm
<time>±hhmm
<time>±hh

Time zones in ISO 8601 are represented as local time (with the location unspecified), as UTC, or as an offset from UTC.

If no UTC relation information is given with a time representation, the time is assumed to be in local time. While it may be safe to assume local time when communicating in the same time zone, it is ambiguous when used in communicating across different time zones. Even within a single geographic time zone, some local times will be ambiguous if the region observes daylight saving time. It is usually preferable to indicate a time zone (zone designator) using the standard's notation.

UTC

If the time is in UTC, add a Z directly after the time without a space. Z is the zone designator for the zero UTC offset. "09:30 UTC" is therefore represented as "09:30Z" or "0930Z". "14:45:15 UTC" would be "14:45:15Z" or "144515Z".

UTC time is also known as 'Zulu' time, since 'Zulu' is the NATO phonetic alphabet word for 'Z'.

Time offsets from UTC

The offset from UTC is appended to the time in the same way that 'Z' was above, in the form ±[hh]:[mm], ±[hh][mm], or ±[hh]. So if the time being described is one hour ahead of UTC (such as the time in Berlin during the winter), the zone designator would be "+01:00", "+0100", or simply "+01". To represent a time behind UTC the offset is shown with a minus sign (Unicode U+2212, written &minus; in HTML), e.g. the time in New York in winter is UTC−05:00. For other time offsets see List of UTC time offsets.

The following times all refer to the same moment: "18:30Z", "22:30+04", "1130−0700", and "15:00−03:30". Nautical time zone letters are not used with the exception of Z. To calculate UTC time one has to subtract the offset from the local time, e.g. for "15:00−03:30" do 15:00 − (−03:30) to get 18:30 UTC.

An offset of zero, in addition to having the special representation "Z", can also be stated numerically as "+00:00", "+0000", or "+00". However, it is not permitted to state it numerically with a negative sign, as "−00:00", "−0000", or "−00". The section dictating sign usage (section 3.4.2 in the 2004 edition of the standard) states that a plus sign must be used for a positive or zero value, and a minus sign for a negative value. Contrary to this rule, RFC 3339, which is otherwise a profile of ISO 8601, permits the use of "-00", with the same denotation as "+00" but a differing connotation.[16]

ISO 8601 permits the hyphen (-) to be used as the minus (−) character when the character set is limited.[17] In contrast, RFC 3339 explicitly requires the hyphen (-) symbol to represent negative offsets and does not allow for use of the minus (−) symbol.[18]

Combined date and time representations

<date>T<time>

A single point in time can be represented by concatenating a complete date expression, the letter T as a delimiter, and a valid time expression. For example, "2007-04-05T14:30".

If a time zone designator is required, it follows the combined date and time. For example, "2007-04-05T14:30Z" or "2007-04-05T12:30-02:00".

Either basic or extended formats may be used, but both date and time must use the same format. The date expression may be calendar, week, or ordinal, and must use a complete representation. The time expression may use reduced accuracy. It is permitted to omit the 'T' character by mutual agreement.[19]

Durations

PnYnMnDTnHnMnS
PnW
P<date>T<time>

Durations are a component of time intervals and define the amount of intervening time in a time interval. They should only be used as part of a time interval as prescribed by the standard. Time intervals are discussed in the next section.

Durations are represented by the format P[n]Y[n]M[n]DT[n]H[n]M[n]S or P[n]W as shown to the right. In these representations, the [n] is replaced by the value for each of the date and time elements that follow the [n]. Leading zeros are not required, but the maximum number of digits for each element should be agreed to by the communicating parties. The capital letters P, Y, M, W, D, T, H, M, and S are designators for each of the date and time elements and are not replaced.

  • P is the duration designator (historically called "period") placed at the start of the duration representation.
  • Y is the year designator that follows the value for the number of years.
  • M is the month designator that follows the value for the number of months.
  • W is the week designator that follows the value for the number of weeks.
  • D is the day designator that follows the value for the number of days.
  • T is the time designator that precedes the time components of the representation.
  • H is the hour designator that follows the value for the number of hours.
  • M is the minute designator that follows the value for the number of minutes.
  • S is the second designator that follows the value for the number of seconds.

For example, "P3Y6M4DT12H30M5S" represents a duration of "three years, six months, four days, twelve hours, thirty minutes, and five seconds".

Date and time elements including their designator may be omitted if their value is zero, and lower order elements may also be omitted for reduced precision. For example, "P23DT23H" and "P4Y" are both acceptable duration representations.

To resolve ambiguity, "P1M" is a one-month duration and "PT1M" is a one-minute duration (note the time designator, T, that precedes the time value). The smallest value used may also have a decimal fraction, as in "P0.5Y" to indicate half a year. This decimal fraction may be specified with either a comma or a full stop, as in "P0,5Y" or "P0.5Y". The standard does not prohibit date and time values in a duration representation from exceeding their "carry over points" except as noted below. Thus, "PT36H" could be used as well as "P1DT12H" for representing the same duration. But keep in mind that "PT36H" is not the same as "P1DT12H" when switching from or to Daylight saving time.

Alternatively, a format for duration based on combined date and time representations may be used by agreement between the communicating parties either in the basic format PYYYYMMDDThhmmss or in the extended format P[YYYY]-[MM]-[DD]T[hh]:[mm]:[ss]. For example, the first duration shown above would be "P0003-06-04T12:30:05". However, individual date and time values cannot exceed their moduli (e.g. a value of 13 for the month or 25 for the hour would not be permissible).[20]

Time intervals

<start>/<end>
<start>/<duration>
<duration>/<end>
<duration>

A time interval is the intervening time between two time points. The amount of intervening time is expressed by a duration (as described in the previous section). The two time points (start and end) are expressed by either a combined date and time representation or just a date representation.

There are four ways to express a time interval:

  1. Start and end, such as "2007-03-01T13:00:00Z/2008-05-11T15:30:00Z"
  2. Start and duration, such as "2007-03-01T13:00:00Z/P1Y2M10DT2H30M"
  3. Duration and end, such as "P1Y2M10DT2H30M/2008-05-11T15:30:00Z"
  4. Duration only, such as "P1Y2M10DT2H30M", with additional context information

Of these, the first three require two values separated by an interval designator which is usually a solidus (more commonly referred to as a forward slash "/"). Section 4.4.2 of the standard notes that: "In certain application areas a double hyphen is used as a separator instead of a solidus." The standard does not define the term "double hyphen", but previous versions used notations like "2000--2002".[21] Use of a double hyphen instead of a solidus allows inclusion in computer filenames.[22] A solidus is a reserved character and not allowed in a filename in common operating systems.

For <start>/<end> expressions, if any elements are missing from the end value, they are assumed to be the same as for the start value including the time zone. This feature of the standard allows for concise representations of time intervals. For example, the date of a two-hour meeting including the start and finish times could be simply shown as "2007-12-14T13:30/15:30", where "/15:30" implies "/2007-12-14T15:30" (the same date as the start), or the beginning and end dates of a monthly billing period as "2008-02-15/03-14", where "/03-14" implies "/2008-03-14" (the same year as the start).

If greater precision is desirable to represent the time interval, then more time elements can be added to the representation. An interval denoted "2007-11-13/15" can start at any time on 2007-11-13 and end at any time on 2007-11-15, whereas "2007-11-13T09:00/15T17:00" includes the start and end times. To explicitly include all of the start and end dates, the interval would be represented as "2007-11-13T00:00/15T24:00".

Repeating intervals

Rnn/<interval>
R/<interval>

Repeating intervals are specified in clause "4.5 Recurring time interval". They are formed by adding "R[n]/" to the beginning of an interval expression, where R is used as the letter itself and [n] is replaced by the number of repetitions. Leaving out the value for [n] means an unbounded number of repetitions. If the interval specifies the start (forms 1 and 2 above), then this is the start of the repeating interval. If the interval specifies the end but not the start (form 3 above), then this is the end of the repeating interval. For example, to repeat the interval of "P1Y2M10DT2H30M" five times starting at "2008-03-01T13:00:00Z", use "R5/2008-03-01T13:00:00Z/P1Y2M10DT2H30M".

Truncated representations

ISO 8601:2000 allowed truncation (by agreement), where leading components of a date or time are omitted. Notably, this allowed two-digit years to be used and the ambiguous formats YY-MM-DD and YYMMDD. This provision was removed in ISO 8601:2004.

Usage

On the Internet, the World Wide Web Consortium (W3C) uses ISO 8601 in defining a profile of the standard that restricts the supported date and time formats to reduce the chance of error and the complexity of software.[23]

RFC 3339 defines a profile of ISO 8601 for use in Internet protocols and standards. It explicitly excludes durations and dates before the common era. The more complex formats such as week numbers and ordinal days are not permitted.[24]

RFC 3339 deviates from ISO 8601 in allowing a zero timezone offset to be specified as "-00:00", which ISO 8601 forbids. RFC 3339 intends "-00:00" to carry the connotation that it is not stating a preferred timezone, whereas the conforming "+00:00" or any non-zero offset connotes that the offset being used is preferred. This convention regarding "-00:00" is derived from earlier RFCs, such as RFC 2822 which uses it for timestamps in email headers. RFC 2822 made no claim that any part of its timestamp format conforms to ISO 8601, and so was free to use this convention without conflict.

ISO 8601 is referenced by several specifications, but the full range of options of ISO 8601 is not always used. For example, the various electronic program guide standards for TV, digital radio, etc. use several forms to describe points in time and durations. The ID3 audio meta-data specification also makes use of a subset of ISO 8601.[25] The GeneralizedTime makes use of another subset of ISO 8601.

The ISO 8601 week date, as of 2006, appeared in its basic form on major brand commercial packaging in the United States. Its appearance depended on the particular packaging, canning, or bottling plant more than any particular brand. The format is particularly useful for quality assurance, so that production errors can be readily traced to work weeks, and products can be correctly targeted for recall.

Related standards

Australia AS ISO 8601-2007
Austria ÖNORM ISO 8601 (replaced ÖNORM EN 28601)
Belgium NBN EN 28601 (1993)
Brazil NBR 5892:1989
Canada CSA Z234.5:1989
China GB/T 7408-2005
Czech Republic ČSN ISO 8601 (replaced ČSN EN 28601)
Denmark DS/ISO 8601:2005 (replaced DS/EN 28601)
European Norm EN ISO 8601, EN 28601:1992 (cancelled 07 october 2011)
Finland SFS-EN 28601
France NF Z69-200; NF EN 28601:1993-06-01 (cancelled)
Germany DIN ISO 8601:2006-09 (replaced DIN EN 28601:1993-02); related: DIN 5008:2011-04 (replaced DIN 5008:2005-05, DIN 5008:2001-11, DIN 5008:1996-05)
Greece ELOT EN 28601
Hungary MSZ ISO 8601:2003
Iceland IST EN 28601:1992
India IS 7900:2001
Ireland IS/EN 28601:1993
Italy UNI EN 28601 (1993)
Japan JIS X 0301-2002
Korea, Republic of KS X ISO 8601
Latvia Ministru kabineta noteikumi Nr.916
Lithuania LST ISO 8601:1997
Luxembourg ITM-EN 28601
Netherlands NEN ISO 8601, NEN EN 28601 (1994), NEN 2772
Norway NS-ISO 8601
Poland PN-90/N-01204
Portugal NP EN 28601
Russia ГОСТ ИСО 8601-2001 (current), ГОСТ 7.64-90 (obsolete)
South Africa ARP 010:1989
Spain UNE EN 28601
Sweden SS-ISO 8601 (replaced SS-EN 28601 (1991))
Switzerland SN ISO 8601:2005-08 (replaced SN-EN 28601:1994)
Taiwan CNS 7648
Thailand TIS 1111:2535 (1992)
Turkey TS ISO 8601
United Kingdom BS ISO 8601:2004, BS EN 28601 (1989-06-30)
Ukraine ДСТУ ISO 8601:2010
United States ANSI INCITS 30-1997 (R2008) and NIST FIPS PUB 4-2
Vietnam TCVN 6398-1:1998

See also

Media related to Lua error in package.lua at line 80: module 'strict' not found. at Wikimedia Commons

Notes and references

  1. 1.0 1.1 ISO 8601:2004[E] section 1 Scope
  2. Lua error in package.lua at line 80: module 'strict' not found.
  3. Lua error in package.lua at line 80: module 'strict' not found.
  4. TC 154 Processes, data elements and documents in commerce, industry and administration, Technical committees – ISO
  5. 5.0 5.1 ISO, FAQ: Numeric representation of Dates and Time
  6. ISO 8601:2004 section 2.3.3 basic format
  7. 7.0 7.1 ISO 8601 uses the word accuracy, not precision, in the relevant section, e.g: 2.3.7 representation with reduced accuracy.
  8. Lua error in package.lua at line 80: module 'strict' not found.
  9. Lua error in package.lua at line 80: module 'strict' not found.
  10. Lua error in package.lua at line 80: module 'strict' not found.
  11. ISO 8601:2004 sections 3.4.2, 4.1.2.4
  12. For example, see Annex B.1.1 of the standard.
  13. ISO 8601:2004 section 4.2.2.3 Representations with reduced accuracy
  14. Lua error in package.lua at line 80: module 'strict' not found.
  15. Lua error in package.lua at line 80: module 'strict' not found.
  16. RFC 3339 – Unknown local offset convention
  17. ISO 8601 §3.4.1 stating, "In an environment where use is made of a character repertoire based on ISO/IEC 646, 'hyphen' and 'minus' are both mapped onto 'hyphen-minus'. Representations with a 'plus-minus' shall only be used in such environment if the interchange repertoire includes 'plus-minus'."
  18. https://tools.ietf.org/html/rfc3339#section-5.6 time-numoffset defined with hyphen symbol
  19. Lua error in package.lua at line 80: module 'strict' not found.
  20. ISO 8601:2004 section 4.4.3.3 Alternative format
  21. Lua error in package.lua at line 80: module 'strict' not found.
  22. Lua error in package.lua at line 80: module 'strict' not found.
  23. Note about Date and Time Formats to W3C from Reuters
  24. RFC 3339, section 5.6
  25. Lua error in package.lua at line 80: module 'strict' not found.

External links

Implementation overview