Create a Duration
of type xdt:dayTimeDuration
using the specified
day
, hour
, minute
and second
as defined in
XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration.
The datatype xdt:dayTimeDuration
is a subtype of xs:duration
whose lexical representation contains only day, hour, minute, and second components.
This datatype resides in the namespace http://www.w3.org/2003/11/xpath-datatypes
.
The XML Schema specification states that values can be of an arbitrary size.
Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
An UnsupportedOperationException
will be thrown with a message indicating implementation limits
if implementation capacities are exceeded.
A null
value indicates that field is not set.
Returns:
New
Duration
created with the specified
day
,
hour
,
minute
and
second
.
Parameters:
-
isPositive - Set to
false
to create a negative duration. When the length
of the duration is zero, this parameter will be ignored.
-
day - Day of
Duration
.
-
hour - Hour of
Duration
.
-
minute - Minute of
Duration
.
-
second - Second of
Duration
.
Throws:
-
IllegalArgumentException - If the values are not a valid representation of a
Duration
: if all the fields (day, hour, ...) are null or
if any of the fields is negative.
-
UnsupportedOperationException - If implementation cannot support requested values.