ISO 8601
| Example combined date/time in UTC: |
| '--TZ' |
| Example separate date and time in UTC: |
| '-- Z' |
| Example date only: |
| '--' |
| Example date with week number: |
| '' |
'ISO 8601' is an international standard for date and time representations issued by the International Organization for Standardization (ISO). Specifically, this standard defines: "Data elements and interchange formats – Information interchange – Representation of dates and times". The signature feature of the ISO 8601 format for date and time is that the information is ordered from the most to the least significant or, in plain terms, from the largest (the year) to the smallest (the second).
History of the standard
The first edition of the ISO 8601 standard was published 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[1].
It has since then been superseded by a second edition in 2000 and finally the current third edition, ISO 8601:2004, published 2004-12-03.
ISO 2014 was the standard that originally introduced the big-endian all-numeric date notation [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.
It is maintained by ISO/TC 154.
General principles
Date and time values are organized ''from most to least significant''. Each value (e.g. year, month, day, time) has a ''fixed number of digits'' which must be padded with leading zeros. For instance, the notation "4:30 a.m." would be written '04:30'. As a result, for each of the several formats of dates and times lexicographical order corresponds to chronological order, except for negative years.
Representation can be done in one of two formats: A ''basic format'' with a minimal number of characters, or an ''extended format'' with separators to enhance human readability.[2] The standard permits a ''hyphen'' separator between date elements, and a ''colon'' between hours, minutes, and seconds. For example, "2006-01-06" may be written "20060106" without ambiguity. The extended formats are preferred over basic formats because some basic formats are ambiguous.
Any number of fields may be dropped from any of the date and time formats, but the least significant fields must be dropped first. For example, "2004-05" is a valid ISO 8601 date, which indicates the 5th month of the year 2004. This date will never represent the 5th day of some unknown month in 2004.
Finally, the standard supports the addition of a ''decimal fraction'' to the smallest time unit, where higher precision is needed.
Dates
The standard uses the leap rule and month sizes of the Gregorian calendar, which is already the de facto standard of international trade.
Years
| YYYY |
|---|
| ±YYYYY |
ISO 8601 prescribes a four-digit year to avoid the year 2000 problem.
To represent years before Year zero or after 9999, the standard also permits expansion of the year, by agreement between sender and receiver[1]. An expanded representation may have (an agreed number of) extra year digits, and is always prefixed with a sign (+ or −), with the convention that 0 is positive.
For purposes of reference ISO 8601 assigns the number 1875 to the year in which the ''Convention du Mètre'' was signed in Paris – a choice that has been criticized for not being reproducible without another calendar.
Calendar date
| YYYY-MM-DD | ''or'' | YYYYMMDD |
|---|---|---|
| YYYY-MM | ''but not'' | YYYYMM |
Calendar dates are the form familiar to most people. As represented in the box to the right, [YYYY] indicates a year with century. [MM] indicates the month of the year, 01 through 12. [DD] indicates the day of that month, from 01 through 31. For example, "5th of April 1981" may be represented as "1981-04-05" in the ''extended format'', or "19810405" in the ''basic format''.
The standard allows for dates to be written with less precision. For example, one may write "1981-04" to mean "1981 April", and one may simply write "1981" to refer to that year. The standard allows both YYYYMMDD and YYYY-MM-DD, but if the day is omitted, only YYYY-MM is allowed. By disallowing dates of the form YYYYMM, the standard avoids confusion with the truncated format YYMMDD (no longer permitted).
Week dates
| YYYY-Www | ''or'' | YYYYWww |
|---|---|---|
| YYYY-Www-D | ''or'' | YYYYWwwD |
Main articles: ISO week date
A week date specifies a so-called 'ISO year' in the format [YYYY], a 'week number' in the format [WW] prefixed by the letter 'W', and the 'weekday number', a digit [D] from 1 through 7, beginning with Monday and ending with Sunday. This form is popular in manufacturing.
Mutually equivalent definitions for week 01 are:
★ the week with the year's first Thursday in it
★ the week with 4 January in it
★ the first week with the majority (four or more) of its days in the starting year
★ 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.
The week number can be described by counting the Thursdays: week 12 contains the 12th Thursday of the year.
The ISO 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 year number deviates from the number of the normal year (Gregorian year) on, if applicable, a Friday, Saturday, and Sunday, or a Saturday and Sunday, or just a Sunday, at the start of the ordinary year (which are at the end of the previous ISO year) and a Monday, Tuesday and Wednesday, or a Monday and Tuesday, or just a Monday, at the end of the ordinary year (which are in week 01 of the next ISO year). For Thursdays the ISO year number is always equal to the ordinary year number.
Examples:
★ 2008-12-29 is written ""
★ 2010-01-03 is written ""
For an overview of week numbering systems see week number. The US system has weeks from Sunday through Saturday, and partial weeks at the beginning and the end of the year. An advantage is that no separate year numbering like the ISO year is needed, while correspondence of lexicographical order and chronological order is preserved.
Ordinal dates
| YYYY-DDD | ''or'' | YYYYDDD |
|---|
''Ordinal dates'' are a simple form for times 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 366 in leap years. For example, "1981-04-05" is also "1981-095".
This format has particular use for simple hardware systems that have need of a date system, but where including full calendar calculation software may be a significant nuisance. This system is frequently, though incorrectly, referred to as the Julian Date.
Times
| hh:mm:ss | ''or'' | hhmmss |
|---|---|---|
| hh:mm | ''or'' | hhmm |
| hh |
ISO 8601 uses the 24-hour clock system that is used by most of the world. 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 notate the midnight at the end of a calendar date. [mm] refers to a minute between 00 and 59. [ss] refers to a second between 00 and 59 (or 60 in the exceptional case of an added leap second). So a time might appear as "13:47:30" or "134730".
It is also acceptable to omit elements to reduce precision. [hh]:[mm], [hh][mm] and [hh] are all used.
Decimal fractions may also be used with any of the three time elements. These are indicated by using the decimal point (either a comma (which is preferred ISO 31) or dot). A fraction may only refer to the most precise component of a time representation – that is, to denote "14 hours, 30 and one half minutes", do not include a seconds figure. Represent it as "14:30,5" or "1430,5".
''Midnight'' is a special case and can be referred to as both "00:00" and "24:00". The notation "00:00" is used at the beginning of the day, and is the most frequently used one. At the end of a day use "24:00". Note that "1981-04-05T24:00" is the same instant as "1981-04-06T00:00" (see Combined representations below).
Time zones
| ''or'' | ||
|---|---|---|
If no time zone information is given with a time, the time zone is assumed to be in some conventional local time zone. While it may be safe to assume a local zone when used between two people in the same area, it is ambiguous when used in communication between multiple timezones. It is usually preferable to indicate a time zone using the standard’s notation.
UTC
If the time is in UTC, add a 'Z' directly after the time, without a space. "09:30 UTC" is therefore represented as "09:30Z" or "0930Z". "14:45:15 UTC" would be "14:45:15Z" or "144515Z". The 'Z' stands for 'Zulu time', an alternative name for UTC.
Other time zones
Other time zones are specified by their ''offset'' from UTC, in the format ±[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 offset would be "+01:00", "+0100" or simply "+01". This is appended to the time in the same way that 'Z' was above. Note that the offset is the actual offset from UTC, and does not include any information on daylight saving time. Times expressed in local time for a user in Chicago would be "-06:00" for the winter (Central Standard Time) and "-05:00" for the summer (Central Daylight Time). 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.
Time zone conversions
A possible source of confusion in doing time zone conversions is the ISO committee's decision to create time expressions using offsets ''from'' UTC rather than ''to'' UTC (i.e., having opposite sign). While a time expression looks like a conversion formula yielding its UTC value, it is not. Reverse the sign in the expression, however, and it is. Referring to the above examples, we see that
18:30 (UTC) = 22:30 - 04:00 = 11:30 + 07:00 = 15:00 + 3:30.
Conversion between time zones obeys the relationship
:"time in zone A" + "offset from zone A ''to'' UTC" = "time in zone B" + "offset from zone B ''to'' UTC",
in which each side of the equation is its UTC value (note the phrases "offset from zone" rather than "offset from UTC").
Using the term "offset" as the Standard does (converting the above additions to subtractions), the conversion equation is
:"time in zone B" = "time in zone A" - "offset from UTC ''to'' zone A" + "offset from UTC ''to'' zone B".
For example, what time is it in Los Angeles when the New York Stock Exchange opens?
:time in zone PST = 09:30 - (-05:00) + (-08:00) = 06:30
Or, just remembering that all offsets have the opposite sign, calculate indirectly via UTC:
:09:30-05 (zone EST) = 14:30Z (UTC) = 06:30-08 (zone PST)
Combined representations
| | |
|---|
Combining ''date'' and ''time'' representations is quite simple. It is in the format of
This article provided by Wikipedia. To edit the contents of this article, click here for original source.
psst.. try this: add to faves

العربية
ä¸å›½
Français
Deutsch
Ελληνική
हिनà¥à¤¦à¥€
Italiano
日本語
Português
РуÑÑкий
Español