ISO 8601 displays dates and times in order of increasing accuracy. For example, the stamp 2017-01-25T12:34:56+00:00 tells us the:
- the year (2017)
- month (January)
- date (25th)
- time (12:34pm and 56 seconds)
- time zone (+00:00, which is Greenwich Mean Time)
When you should use ISO 8601
The date-times and time-stamps guidance mandates using the ISO 8601 when you want to show date and time within:
- API responses
- metadata in documents
- internal document titles
- any other machine-to-machine communication
The Open Standards Board mandates using ISO 8601 for use where it’s relevant because user research found 2 limitations. We recommend the standard is best suited for machine-to-machine communication, at present.
Here are a couple of examples of the limitations we found.
A local council may send a resident a text message let them know the date of their rubbish collection. The ideal message will include the day of collection, such as ‘Thursday’. However, ISO 8601 does not cover names of days.
Secondly, people can find it hard to read an 8601 string if they are unfamiliar with it. The NHS told us that labels on medicines should conform to the NHS Common User Interface Design Guidelines and take the form 01-JAN-2017. This format displays all the relevant information and is easier to read than the ISO 8601 string.
Why ISO 8601 is mandated
There are many ways to write the time. We found a government document with the stamp - 170356Z JULY 03. This stamp tells us the document was a telegram sent on the 16th of July 2003 at 11:56pm. You’ll struggle to decipher this unless you’re familiar with the ACP 121 standard.
Even dates written in the form 01/02/2015 can present a problem. Is this the first of February, or the second of January? American and European readers will have a different answer. What about the time 1510924348? That's the number of seconds since the start of 1970.
We've chosen ISO 8601 because it’s a worldwide standard all modern programming languages support. ISO 8601 provides high precision, is timezone aware and is easy for humans to understand. It's also used by NASA, (which will be useful if GDS goes into space!)
Using ISO 8601 will help us increase precision, reduce ambiguity, and make it easier to compare different dates.
Is ISO 8601 an open standard?
Sadly, ISO 8601 doesn't meet our definition of an open standard as it’s locked behind a paywall. You need to pay around £100 if you want to read the official version of how to implement the standard instead of the Wikipedia entry.
We're currently in discussions with ISO about how we can make the standard open as payment restrictions should not apply to core internet technology standards.
Overall, we’ve decided the benefits of ISO 8601 still outweigh the negatives. ISO 8601 is universal - many of the standards we mandate refer to ISO 8601, every programming language we use has an ISO 8601 aware time library, and there are many reference implementations freely available.
We're going to do our best to open the standard up and we'll let you know how we get on.