Date and time formats are par­tic­u­lar­ly important when making deals and arranging meetings. However, in the age of digital glob­al­iza­tion, it is becoming in­creas­ing­ly difficult to specify dates and times in a way everyone un­der­stands. Various time zones around the world and different cultural customs for for­mat­ting time make it difficult to state exact times and dates across national borders. ISO 8601 solves precisely this problem. By agreeing to this in­ter­na­tion­al standard, all stake­hold­ers worldwide can un­am­bigu­ous­ly specify times and dates.

De­f­i­n­i­tion: ISO 8601

The in­ter­na­tion­al standard ISO 8601 provides rec­om­men­da­tions for numerical date and time formats.

You can use various tools or scripts to convert date in­for­ma­tion into the desired ISO date format. This article explains all you need to know about the in­ter­na­tion­al standard for dates and times.

$1 Domain Names – Grab your favorite one
  • Simple reg­is­tra­tion
  • Premium TLDs at great prices
  • 24/7 personal con­sul­tant included
  • Free privacy pro­tec­tion for eligible domains

Basic Prin­ci­ples of the ISO 8601 Standard

The ISO 8601 standard defines an in­ter­na­tion­al­ly rec­og­nized format for rep­re­sent­ing 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 de­lim­iters. According to the basic format of ISO 8601, the date “September 7, 2019” is written as follows: “20190907”, or when expressed with de­lim­iters: “2019-09-07”. Times are divided into hours, minutes, and seconds. An ISO 8601 timestamp would therefore be: 12:07:22. The rep­re­sen­ta­tion of ISO date formats does away with the need for country-specific notations, at least in elec­tron­ic formats. This way, time and date in­for­ma­tion is stan­dard­ized, resulting in fewer com­mu­ni­ca­tion 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 “de­scend­ing notation”. It cor­re­sponds with the natural math­e­mat­ic value of numbers. Larger units are therefore always written before smaller units. This is ad­van­ta­geous as it means the lex­i­co­graph­i­cal and chrono­log­i­cal sorting of dates and times will produce the same result.

Tabular rep­re­sen­ta­tion of ISO 8601 dates and times

Format according to ISO 8601 Value ranges
Year (Y) YYYY, four-digit, ab­bre­vi­at­ed 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 in­di­vid­ual unit is rep­re­sent­ed by a fixed number of digits. Es­pe­cial­ly in sci­en­tif­ic fields, software de­vel­op­ment, and in­ter­na­tion­al cor­re­spon­dence, the standard is used in order to reduce the risk of errors with time values. The in­ter­na­tion­al­ly stan­dard­ized ISO 8601 timestamp reduces this risk con­sid­er­ably.

Following the date and time values, the dif­fer­ence compared to the rec­og­nized universal time is often indicated (ab­bre­vi­at­ed to UTC). This is how the format takes any time zone dif­fer­ences or country-specific summer times into con­sid­er­a­tion. The letter “Z” is generally used as the cor­re­spond­ing value.

Tabular rep­re­sen­ta­tion of ISO 8601 dates and times with time zone in­for­ma­tion

Example Ex­pla­na­tion
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 en­com­pass­es the years from 1583 to 1999. This is because the Gregorian calendar was only in­tro­duced in 1583. Although it’s possible to apply the ISO 8601 standard to times and dates before the year 1583, this requires exact co­or­di­na­tion between the parties sharing the values in order to avoid errors.

Ad­van­tages 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 sub­sti­tute for language-dependent wording, such as “February 1, 1995”. But ISO 8601 should be applied to replace des­ig­na­tions like “2/5/95” and “9:30 am”.

The ad­van­tages of the ISO8 8601 standard can be sum­ma­rized as follows:

  • Easy to read and write with software
  • Easily to compare and sort with a simple string com­par­i­son
  • Un­der­stand­able re­gard­less of the national language
  • Cannot be confused with other common date rep­re­sen­ta­tions
  • Cor­re­sponds 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, sim­pli­fy­ing 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 wide­spread, 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

Con­vert­ing Dates

The format can generally be converted in two different di­rec­tions. On the one hand, a date or time value can be converted to the ISO standard from a national con­ven­tion, as well as from the ISO format into the national language on the other.

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

String dateString = "2019-09-26T07:58:30.996+0200"

This string is now struc­tured 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 con­ver­sion can transform the ISO date into the typical US format, i.e. hh:mm, MM.DD.YYYY (hour, minute – month, day, year).

public String getOurDate() {
DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
try {
    Date unformatedDate = format.parse(date);
    String formatedDate = new SimpleDateFormat("HH:mm dd.MM.yyyy").format(unformatedDate);
    return formatedDate;
    }   catch (ParseException e){
            System.out.println("Error")
    }
    return date;
}
Tip

In addition to the manual pos­si­bil­i­ties for con­ver­sion, websites can also be found online that au­to­mat­i­cal­ly convert time­stamps to the desired format. For example: DenCode Converter. Simply enter the date in the initial format and then select the target format for con­ver­sion. The time zone can also be chosen.

Go to Main Menu