© Crown copyright 2018
This publication is licensed under the terms of the Open Government Licence v3.0 except where otherwise stated. To view this licence, visit nationalarchives.gov.uk/doc/open-government-licence/version/3 or write to the Information Policy Team, The National Archives, Kew, London TW9 4DU, or email: email@example.com.
Where we have identified any third party copyright information you will need to obtain permission from the copyright holders concerned.
This publication is available at https://www.gov.uk/government/publications/open-standards-for-government/date-times-and-time-stamps-standard
The ISO 8601 standard is an internationally accepted way to represent dates and times using numbers. The Open Standards Board has selected this standard for the exchange of date and time in government systems.
New systems and services must use the date and time-stamp standard ISO 8601:2004
1. Summary of the standard’s use for government
Use ISO 8601 for dates and times where machine readability is the main concern. This includes use in:
- data exchanges such as metadata in documents and websites
- date sorting, for example, at the start of some filenames
ISO 8601 does not apply when human readability is the main concern. For example, dates and times added within the text of a document.
Read more about the original Challenge.
2. How this standard meets user needs
The Challenge identifies the need to avoid inconsistency in the exchange and recording of date and time information. By adopting the standard ISO 8601, systems have a reduced inconsistency of how they format data.
ISO 8601 gives the user the flexibility to choose the level of date and time precision required.
3. Benefits of using this standard
By using ISO 8601 as the standard form for the representation of dates and time there is:
- greater consistency
- less confusion about which format to use
- an easier way to sort documents by date and filename
- improved international interoperability by reducing the ambiguity around time zones and date formats
4. How to implement the standard
Use ISO 8601 to the level of accuracy you require when a date or date and time is being recorded or exchanged in an IT system.
List date and time elements in descending order of size (years, months, days, hours, minutes, seconds, milliseconds, and microseconds).
This profile is based on the assumption that you’re using local time. A Coordinated Universal Time (UTC) offset may be added. For example, 2017-05-16T10:30:56+01:00 shows the instant of the 16 May 2017 at 30 minutes and 56 seconds past 10am. The offset in this example is British summer time (BST), one hour ahead of UTC.
The standard’s format has a fixed number of digits padded with leading zeros to support different levels of accuracy. The lowest level is four digits to represent a year, and as you increase accuracy by adding the month, week or day the digits replace the zero padding. When using a less accurate date, include hyphen separators to avoid user confusion, for example, separate the digits for the year and the month - YYYY-MM.
If required, separate time from the date by a ‘T’ character and record in a 24-hour format with 2 digits per element. The time format uses a ‘:’ separator between hours and minutes.
5. How to integrate the standard
ISO 8601 has broad compatibility with other date standards:
- RFC 3339 simplifies ISO 8601 for use in Internet protocols by omitting infrequently used options - most fields are mandatory, the exception being fractions of a second, the use of which is optional
- W3C date and time format is an ISO 8601 profile written to simplify its use in WWW standards
Standards already accepted by the Open Standards Board cite ISO 8601. These standards are the:
- Exchange of calendar events - iCAL
- Exchange of contact information - vCard
- Sharing or collaborating with government documents - ODF 1.2
- Open contracting data - OCDS
- International development data - IATI
- Publishing vacancies - JobPosting
- Multi-agency incident transfer - MAIT
- Viewing government documents - HTML5
This standard is not suitable where the use of date and time is primarily for human readers. The GOV.UK Service Manual has guidance on the use of dates in digital services for consistent user experience.