Dated URIs
ISO 8601
Different date formats are used in different countries. Ignoring
differences of separator (-, . or /), these
are:
- YY-MM-DD in Japan
- DD-MM-YY in Europe
- MM-DD-YY in the US
Dates in these formats are ambiguous on the internet unless the format is
also specified. ISO (International Organization for Standardization) has
published a standard, ISO 8601, for dates and
times. This format is well-suited for use with computers and on the
internet.
Why ISO 8601?
- Widely used with computers and on the internet
- Lexicographic sort automatically sorts by time
URI Structure
Webpages published frequently
- Provide a hierarchy
- Start with the format with hyphens and colons
- Replace hyphens and colons by slashes
- Add slashes at the beginning and at the end of the date
Webpages published rarely
- Do not provide a hierarchy
- Use the format without hyphens and colons
Examples
Domain |
Example |
With Hierarchy |
Without Hierarchy |
Day |
2004 March 20 |
/2004/03/20/ |
20040320 |
Month |
2004 March |
/2004/03/ |
200403 |
Year |
2004 |
/2004/ |
2004 |
Week |
12th week of 2004 (March 15 Monday to March 21 Sunday) |
/2004/w12/ |
2004w12 |
Day of Week |
6th day (Saturday) of 12th week of 2004
(March 20) |
/2004/w12/6/ |
2004w126 |
Day of Year |
80th day of 2004 (March 20) |
/2004/080/ |
2004080 |
Period of Time
- ISO 8601 classifies a week that falls across two years
into that year which has more days of the week. The same principle could
be followed when any period falls across two years
- A period that falls equally across two years could be
classified into the earlier year
- Example: 2003 July to 2004 June could be classified as
2003
Sufficient Conditions for Uniqueness
- The granularity of the domain (
day
, month
,
year
, etc.) must be more than the duration of the period
- Example: If a year is divided into two half-years, then
the
year
domain cannot be used for the half-years. A domain
with more granularity, like month
, needs to be
used
- Periods must not overlap
Further Reading
- Kuhn explains ISO 8601 in detail
in
A Summary of the International Standard Date and Time Notation
- Korpela gives examples implementing
ISO 8601 in some programming languages in
Info on ISO 8601, the date and time representation standard
- Berners-Lee explains why
Cool URIs don’t change
- Théreaux advises to
Choose URIs Wisely