What is the canonical representation of ISO 8601 length zero?

http://en.wikipedia.org/wiki/ISO_8601#Durations

It is not clear what is the most correct representation of zero in ISO 8601 lengths.

Possible candidates:

PT0S

      

This site: http://www.ostyn.com/standards/scorm/samples/ISOTimeForSCORM.htm says

PT0H0M0S

      

Or perhaps the simplest

P

      

But what is the most correct? Is there a canonical zero duration representation?

+3


source to share


1 answer


The single "P" is definitely wrong because at least one duration element must be present.

The SCORM specification requires "PT0H0M0S" only because it is backward compatible with earlier versions of SCORM, not because ISO complies with it. Quoting from the link you provided:

The SCORM 2004 1.3.1 conformance test suite was coded to require the PT0H0M0S format for an initial zero total try time; therefore it is recommended to use this format where compatibility with earlier implementations of SCORM 2004.

So, if you are not using SCORM, "PT0S" is sufficient. However, I do not remember the place in the original ISO-8601 paper where they indicated what zero time should look like. In contrast, ISO-8601 also describes alternative duration formats such as "P0000-00-00T00: 00".

There is not only one single canonical representation if we interpret the word "canonical" as "conforming to ISO-8601".

Update (after viewing the original ISO paper):



ISO-8601 contains at least one element for zero duration (4.4.3.2.c - p. 21):

If the number of years, months, days, hours, minutes, or seconds in any of these expressions is zero, the number and corresponding designation may be missing; however, at least one number and a pointer must be present.

Clause 4.4.3.3 says:

The complete representation of the expression for duration in alternate format is as follows:

Basic format: PYYYYMMDDThmmss or PYYYYDDDThhmsms

Extended format: PYYYY-MM-DDThh: mm: ss or PYYYY-DDDThh: mm: ss

Keep in mind that not every software is capable of supporting all format variations.

+5


source







All Articles