Draft profile of ISO 8601

Though I have been reluctant to write a profile of [ISO 8601], the W3C HTML WG
has decided it wants the spec for Cougar (the next version of HTML) to
reference a date/time profile and I've been actioned to produce this profile by
the end of next week.  This note lists some preliminary thoughts for comment. 
If you want to find out more about [ISO 8601], visit [KUHN].

I wrote a few days ago that my goal is a profile which is:
-  conformant,
-  widely adopted,
-  easy to understand,
-  not too permissive,
-  not too restrictive,
-  electronically available.

The way to reconcile some of these requirements is to provide a profile
allowing several options, especially regarding granularity.  Other standards
could refer to the profile and state which option has/have been adopted.  A
rough sketch follows.  I have borrowed some phrases from [KUHN].

Granularity
===========

This profile of [ISO 8601] defines four levels of granularity:

1.  Date only
-------------

The format is: YYYY-MM-DD

2.  Date plus hours and minutes
-------------------------------

The format is one of: YYYY-MM-DDThh:mmZ
                      YYYY-MM-DDThh:mm+hh:mm
                      YYYY-MM-DDThh:mm-hh:mm
where:

   Z       indicates that the date/time uses Universal Time (UTC),

   +hh:mm  indicates that the date/time uses a local time zone which is "hh"
           hours and "mm" minutes ahead of UTC,

   -hh:mm  indicates that the date/time uses a local time zone which is "hh"
           hours and "mm" minutes behind UTC.

3.  Date plus hours, minutes and seconds
----------------------------------------

The format is one of: YYYY-MM-DDThh:mm:ssZ
                      YYYY-MM-DDThh:mm:ss+hh:mm
                      YYYY-MM-DDThh:mm:ss-hh:mm

4.  Date plus hours, minutes, seconds and decimal fractions of seconds
----------------------------------------------------------------------

The format is one of those shown in option 3, with the insertion, immediately
after "ss", of either a full stop or a comma, followed immediately by one or
more digits representing a decimal fraction of a second, eg:

                      YYYY-MM-DDThh:mm:ss.ddZ
                      YYYY-MM-DDThh:mm:ss.dd+hh:mm
                      YYYY-MM-DDThh:mm:ss.dd-hh:mm

If adopting this granularity option, the adopting standard must state how many
digits may be used to represent a decimal fraction of a second, eg:

   2 digits,
   1-3 digits,
   1-99 digits,
   any number of digits.

Treatment of missing elements
=============================

In some cases, software components may need to compare a date/time using
coarser granularity with one using finer granularity.  This shall be done as
described below.

Granularity options 2-4
-----------------------

The missing portions are deemed to be equal to zero.  Thus the following all
represent the same date/time:

   1997-06-20T12:34Z
   1997-06-20T12:34:00Z
   1997-06-20T12:34:00.00Z
   1997-06-20T12:34:00.000000000000000000000000000Z

Granularity option 1
--------------------

An isolated date is treated as if it had the following string appended:

   T12:00Z

For example:

   1997-06-20

is treated as if it were:

   1997-06-20T12:00Z

This approach, proposed by Charles Wicksteed, has the advantage that at
1997-06-20T12:00Z, most of the world would agree that the current date is
1997-06-20.

Comments?

~~~

[ISO 8601] "Data elements and interchange formats -- Information interchange --
Representation of dates and times", ISO 8601:1988(E), International
Organization for Standardization, June, 1988.

[KUHN] "A Summary of the International Standard Date and Time Notation", Markus
Kuhn, <http://www.ft.uni-erlangen.de/~mskuhn/iso-time.html>, 1996-11-05.

[NEWMAN] "Date and Time on the Internet", Chris Newman,
<draft-newman-datetime-01.txt>, January 1997.

-----------------------------------------------------------------------
Misha Wolf            Email: misha.wolf@reuters.com     85 Fleet Street
Standards Manager     Voice: +44 171 542 6722           London EC4P 4AJ
Reuters Limited       Fax  : +44 171 542 8314           UK

------------------------------------------------------------------------

Any views expressed in this message are those of the individual sender, except
where the sender specifically states them to be the views of Reuters Ltd.

Received on Friday, 20 June 1997 17:05:22 UTC