The ISO solution to a long-standing source of confusion
So! Who remembers the Y2K bug? And the cries that the end of civilization as we know it is at hand?
Was it all hype? Well, there were indeed serious fears that older IT equipment might recycle back to 1900 or not make it through the roll-over into the year 2000, because of the way they were programmed and dates were represented in that programming. It was less of a problem for more recent equipment, but this did not mean that a good, clean transition was guaranteed, and all IT users everywhere needed to check and verify their systems.
So, all's well that ends well?
Not quite! There is still the little bothersome business that in order to get from A to B, one can end up with an airline ticket that says you are travelling from A to C on, for example, 02-03-02, with a connecting train ticket from C to B carrying a date of 02-02-03. Has someone invented a time machine?
Table of contents :
How can one avoid confusion when a date like 08/04/02 has at least six different interpretations around the world? A notation like 01/02/03 could mean 1 February 2003 or 2 January 2003 or 2 March 2001. Usually by deduction one can sort it out. Usually - but sometimes, huge and costly confusions can arise. The problem is that all-numeric dates are not unambiguous and depend very much on local custom. That's usually OK within a country or region even if there are local inconsistencies between firms and administrations; but outside…?
A simple nicety, you might say. Does this all matter? Well, it certainly does if you "misinterpreted" what was on that ticket. And if you multiply this type of unfortunate occurrence by millions,in business contexts as well as at the individual level, you can see that the compounded problem is something quite frightening - well after the "Y2K bug" scare has receded. Perhaps not in a daily life, when you write to Cousin Bill in Atlanta, or Auntie Jenny in Australia where the systems of writing dates may be different. But think of the number of times that dates and times crop up in business dealings of all sorts, from insurance forms to travel agencies, from banks to tax forms. And there, huge stakes hang on dates, that can make the difference between winning a fortune… or losing it. Goods being traded internationally are relying on the right dates at each and every step - and wrong dates often mean wrong deliveries or no deliveries at all! And dates have caused many problems to computer programmers.
On the Internet, all kinds of notations are used, some language-dependent, and are they all correctly understood on the other side of the globe? Not so sure. Firms and administrations make use of dates in most of their daily operations in one form or another and in most documents used in international trade… and to have a universally compatible form of representation for them makes pure good sense.
So then: wouldn't it be wonderful if there were an internationally agreed standard?
Well, there is.
It is ISO 8601, Data elements and interchange formats – Information interchange – Representation of dates and times, and we give you here an idea of how the system functions and the standard works (the full standard runs to 33 pages). It's a vitally useful tool for businesses of all kinds, and is totally foolproof. Date representation may look like a detail, but in reality to avoid those costly mistakes, isn't it worth investigating a watertight solution?
ISO 8601:2004 is based on, incorporates and cancels a variety of previous standards with a view to achieving one simple, logical and coherent format for all dates, times, and periods of time requiring to be represented. This system primarily avoids confusion, but also has the advantage of flexibility; you can express every element of time or only the ones you need.
The next time you turn up at the airport or train station on the wrong day, you should demand to know why more people are not using this standard.
The standard offers representations for the following:
- Time of the day
- Coordinated universal time (UTC)
- Local time with offset to UTC
- Date and time
- Time intervals
- Recurring time intervals
Representations can be in one of two formats: a basic format that has a minimal number of characters and an extended format that adds characters to enhance human readability. For example, the third of January 2003 can be represented as either 20030103 or 2003-01-03.
How it works – examples
ISO 8601 advises numeric representation of dates and times on an internationally agreed basis. It represents elements from the largest to the smallest element: year-month-day:
- Calendar date is the most common date representation. It is:
where YYYY is the year in the Gregorian calendar, MM is the month of the year between 01 (January) and 12 (December), and DD is the day of the month between 01 and 31.
Example: 2003-04-01 represents the first day of April in 2003.
- Week date is an alternative date representation used in many commercial and industrial applications. It is:
where YYYY is the Year in the Gregorian calendar, ww is the week of the year between 01 (the first week) and 52 or 53 (the last week), and D is the day in the week between 1 (Monday) and 7 (Sunday).
Example: 2003-W14-2 represents the second day of the fourteenth week of 2003.
- Time of the day is the time representation, using the 24-hour timekeeping system. It is:
where hh is the number of complete hours that have passed since midnight, mm is the number of complete minutes since the start of the hour, and ss is the number of complete seconds since the start of the minute.
Example: 23:59:59 represents the time one second before midnight.
- Date and time represents a specified time of a specified day. When use is made of the calendar date the representation is:
where the capital letter T is used to separate the date and time components. Thus, for a very precise date and time, look at this:
Example: 2003-04-01T13:01:02 represents one minute and two seconds after one o'clock in the afternoon of 2003-04-01.
The standard has provisions for:
- the omission of components representing smaller units (seconds, minutes), where such precision is not needed,
- the addition of a decimal fraction to the smallest time unit where higher precision is needed.
The representations of ISO 8601 offer the following advantages over many of the locally used representations:
- Easily readable and writeable by systems
- Easily comparable and sortable
- Language independent
- Larger units are written in front of smaller units
- For most representations the notation is short and of constant length
Some of the representations permitted by the standard can be used without further agreement. Others should only be used by mutual agreement between the communicating partners; such agreement could be established for instance by mentioning the representation explicitly in a standard or specification applying the representation. This will facilitate processing at the receiving and may be necessary to avoid ambiguity when interpreting ISO 8601 expressions.
Specifications applying ISO 8601 can have a need to define the allowed representation of the expressions in a certain data field. For instance a specification might want to define that a certain field containing the date and time of an event should do so in the format: YYYYMMDDhhmm with the exclusion of all other formats allowed by ISO 8601. In such cases the meta language used internally in ISO 8601 can be used.
ISO 8601 does not specify the exact meaning of its representations. This means for example that the standard does not define whether 09:00 refers to the exact end of the ninth hour of the day, any other point in the following minute or the minute as a whole. Users of the standard must agree on a more exact interpretation of the representation if this is relevant.
Who uses this standard?
ISO 8601 will find usage in computer programmes, logbooks, contest entries, QSL cards, magazine reports, Web pages, e-mail, statistics, forms of all kinds, administrations and businesses, in customs and transportation, in e-commerce and academia, and in all types of international activity.
ISO 8601 corresponds to the UN Working Party on the Facilitation of International Trade Procedures in its Recommendation 7.
The new format has already been adopted by many organizations worldwide. And many more should do so – to make their own lives simpler. And everybody else's.
Why don't you?