W3C Duration Values

This value conforms to the W3C schema data type: duration with a P prefix and a T date/time separator.

Examples:

// 12 years, 17 months, 180 days, 100 hours, 100 minutes, 100 seconds
P12Y17M180DT100H100M100S
// A negative duration
-P12Y17M180DT100H100M100S

The value text may not include any embedded blanks.

Data validation is case-sensitive and requires specification of uppercase alphabetic characters within these values.

All Duration elements are optional but at least one element must be specified. Unspecified elements are assumed to have a zero value - that is, the following values are equivalent:

P12DT30S
P0Y0M12DT0H0M30S

If any Hour, Minute, or Second elements are specified, the value string must include a T date/time separator; otherwise it must not include such a separator.

Specification requirements for the elements follow:

Additional Examples

P12Y         // 12 years
P12Y60M      // 12 years, 60 months
P12YT48H99M  // 12 years, 48 hours, 99 minutes
-PT48H        // -48 hours

The Engine imposes restrictions on the magnitude of Duration literal constants.

The maximum and minimum bounds vary according to the start DateTime (if any) associated with a Duration value. In any case, a Duration magnitude can never exceed +/- 9,223,372,036,768,375 seconds (approximately +/- 292,270,000 years).

Only a subset of the W3C specifications is supported. The Fractional-Second values, for example, P23YT100.34S, is not supported.