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 |
1985 April 12 |
/1985/04/12/ |
19850412 |
Month |
1985 April |
/1985/04/ |
198504 |
Year |
1985 |
/1985/ |
1985 |
Week |
15th week of 1985 (April 8 Monday to April 14 Sunday) |
/1985/w15/ |
1985w15 |
Day of Week |
5th day (Friday) of 15th week of 1985
(April 12) |
/1985/w15/5/ |
1985w155 |
Day of Year |
102nd day of 1985 (April 12) |
/1985/102/ |
1985102 |
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: 1985 July to 1986 June could be classified as
1985
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
- Korpela explains ISO 8601 in detail
with implementation examples in
Info on ISO 8601, the date and time representation standard
- ISO has a brain-dead policy—it
does not give free access to its standards. However, the
Final Draft of ISO 8601 is available