Iso 8601 Utc

ISO 8601:1988 Date/Time Representations

Gary Houston

Utc was formerly used as the international civil time standard, now superseded in that function by Coordinated Universal Time (UTC). ISO 8601 - Wikipedia ISO 8601 is an international standard covering the exchange of date- and time-related data. The toISOString method returns a string in ISO format (ISO 8601 Extended Format), which can be described as follows: YYYY-MM-DDTHH:mm:ss.sssZ. The timezone is always UTC as denoted by the suffix 'Z'. The toISOString method returns a string in simplified extended ISO format (ISO 8601), which is always 24 or 27 characters long (YYYY-MM-DDTHH:mm:ss.sssZ or ±YYYYYY-MM-DDTHH:mm:ss.sssZ, respectively). The timezone is always zero UTC offset, as denoted by the suffix 'Z'.

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. Failed midterm. 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

Date

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)

Iso 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:

  • +1300 or +13:00
  • +13
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.

Iso 8601 Timestamp

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:
  1. 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).
  2. When the date format is truncated on the left, the leading hyphens may be omitted.
Utc

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

Iso 8601 Utc
  • 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).
Examples 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.

Iso 8061

Date and time formats are particularly important when making deals and arranging meetings. However, in the age of digital globalisation, it is becoming increasingly difficult to specify dates and times in a way everyone understands. Various time zones around the world and different cultural customs for formatting time make it difficult to state exact times and dates across national borders. ISO 8601 solves precisely this problem. By agreeing to this international standard, all stakeholders worldwide can unambiguously specify times and dates.

The international standard ISO 8601 provides recommendations for numerical date and time formats.

You can use various tools or scripts to convert date information into the desired ISO date format. This article explains all you need to know about the international standard for dates and times.

Iso 8601 Utc Format

Basic Principles of the ISO 8601 Standard

The ISO 8601 standard defines an internationally recognised format for representing dates and times. For times, they are expressed with the notation hours-minutes-seconds. In the case of dates, the format is year-month-day. This basic format enables the numbers to be written directly after another. For greater clarity, they can also be separated by delimiters. According to the basic format of ISO 8601, the date “September 7, 2019” is written as follows: “20190907”, or when expressed with delimiters: “2019-09-07”. Times are divided into hours, minutes, and seconds. An ISO 8601 timestamp would therefore be: 12:07:22. The representation of ISO date formats does away with the need for country-specific notations, at least in electronic formats. This way, time and date information is standardised, resulting in fewer communication issues.

The ISO 8601 standard is also known as ANSI INCITS 30-1997 (R2008) or NIST FIPS PUB 4-2 in the United States. What’s more, it’s not only used for time values but also for durations. In such cases, the start date or time is separated from the following duration by the letter “P”. A duration that begins on September 6, 2019 at 8:00 pm and lasts one month, five days, and three hours would be expressed per the ISO standard as follows: 2019-09-06T20P1M5T3H.

According to the ISO standard, all values like times, dates or durations are shown in a certain order: They start with the largest unit and proceed to the next smaller value. This sequence is known as “descending notation”. It corresponds with the natural mathematic value of numbers. Larger units are therefore always written before smaller units. This is advantageous as it means the lexicographical and chronological sorting of dates and times will produce the same result.

Tabular representation of ISO 8601 dates and times

Format according to ISO 8601 Value ranges
Year (Y) YYYY, four-digit, abbreviated to two-digit
Month (M) MM, 01 to 12
Week (W) WW, 01 to 53
Day (D) D, day of the week, 1 to 7
Hour (h) hh, 00 to 23, 24:00:00 as the end time
Minute (m) mm, 00 to 59
Second (s) ss, 00 to 59
Decimal fraction (f) Fractions of seconds, any degree of accuracy

In all formats of the standard, the values for dates or times are divided into various units, such as year, month, day, hour etc. Each individual unit is represented by a fixed number of digits. Especially in scientific fields, software development, and international correspondence, the standard is used in order to reduce the risk of errors with time values. The internationally standardised ISO 8601 timestamp reduces this risk considerably.

Following the date and time values, the difference compared to the recognised universal time is often indicated (abbreviated to UTC). This is how the format takes any time zone differences or country-specific summer times into consideration. The letter “Z” is generally used as the corresponding value.

Tabular representation of ISO 8601 dates and times with time zone information

Example Explanation
2019-09-07T-15:50+00 3:30 pm on September 7, 2019 in the time zone of universal time
2019-09-07T15:50+00Z Likewise, 3:30 pm on September 7, 2019 in the time zone of universal time with the addition of “Z” in the notation
2019-09-07T15:50-04:00 3:30 pm on September 7, 2019 in the time zone New York (UTC with daylight saving time)

However, it’s important to note that the valid range of years in this format only encompasses the years from 1583 to 1999. This is because the Gregorian calendar was only introduced in 1583. Although it’s possible to apply the ISO 8601 standard to times and dates before the year 1583, this requires exact coordination between the parties sharing the values in order to avoid errors.

Advantages of the ISO 8601 Standard Compared to Other Common Variants

ISO 8601 only specifies numerical notations and does not cover any dates and times in which words are included. It’s not intended as a substitute for language-dependent wording, such as “February 1, 1995”. But ISO 8601 should be applied to replace designations like “2/5/95” and “9:30 am”.

Iso 8601 Utc Examples

The advantages of the ISO8 8601 standard can be summarised as follows:

  • Easy to read and write with software
  • Easily to compare and sort with a simple string comparison
  • Understandable regardless of the national language
  • Cannot be confused with other common date representations
  • Corresponds with the standard 24-hour time system in which the larger units (hours) are also placed in front of small units (minutes and seconds)
  • Strings that contain a date followed by a time are also easy to compare and sort (e.g. “2019-09-07 20:15:00”)
  • Notation is concise and has a constant length, simplifying keyboard entry and table layout
  • Identical to Chinese date notation, meaning the largest cultural group (>25%) in the world is already familiar with the system
  • Date values with the order “year, month, day” are also widespread, such as in Japan, Korea, Hungary, Sweden, Finland, Denmark, and some other countries
  • A four-digit year format does not lead to any problems at the turn of a century

Converting Dates

The format can generally be converted in two different directions. On the one hand, a date or time value can be converted to the ISO standard from a national convention, as well as from the ISO format into the national language on the other.

Iso 8601 Utc

When converting from the ISO date into a “simple” legible form, the ISO 8601 timestamp normally looks like this:

This string is now structured in the date format YYYY-MM-DD. The delimiter for the time is “T” and the time format is hh:mm:ss plus the UTC suffix .sssz. The complete format is therefore: YYY-MM-DD “T” hh:mm:ss.SSSZ.

The following conversion can transform the ISO date into the typical US format, i.e. hh:mm, MM.DD.YYYY (hour, minute – month, day, year).

In addition to the manual possibilities for conversion, websites can also be found online that automatically convert timestamps to the desired format. For example: DenCode Converter. Simply enter the date in the initial format and then select the target format for conversion. The time zone can also be chosen.

Iso 8601 Date Format Converter

Related articles