xsd:duration represents a duration of time expressed as a number of years, months, days, hours, minutes, and seconds. The format of
P is a literal value that starts the expression,
nY is the number of years followed by a literal
nM is the number of months followed by a literal
nD is the number of days followed by a literal
T is a literal value that separates the date and time,
nH is the number of hours followed by a literal
nM is the number of minutes followed by a literal
nS is the number of seconds followed by a literal
S. The following rules apply to
Any of these numbers and corresponding designators may be absent if they are equal to 0, but at least one number and designator must appear.
The numbers may be any unsigned integer, with the exception of the number of seconds, which may be an unsigned decimal number.
If a decimal point appears in the number of seconds, there must be at least one digit after the decimal point.
A minus sign may appear before the
Pto specify a negative duration.
If no time items (hour, minute, second) are present, the letter
Tmust not appear.
Simple Type Information
Schema Document: datatypes.xsd
- Based on xsd:anySimpleType
- White Space: collapse
|2 years, 6 months, 5 days, 12 hours, 35 minutes, 30 seconds|
|1 day, 2 hours|
|20 months (the number of months can be more than 12)|
|20 months (0 is permitted as a number, but is not required)|
|minus 60 days|
|1 minute, 30.5 seconds|
|the minus sign must appear first|
|no time items are present, so "|
|no value is specified for months, so "|
|only the seconds can be expressed as a decimal|
|years must appear before months|
|at least one number and designator are required|
|at least one digit must follow the decimal point if it appears|
|an empty value is not valid, unless |